Skip to content

Commit 2e70529

Browse files
authored
Updated conformance results for pyright 1.1.364. (#1744)
This version of pyright fixes one conformance issue detected by the "dataclasses_final" test. It also rewords some existing error messages, which accounts for the other changes. Fixed a recent regression in the "dataclasses_final" test due to auto-formatting.
1 parent d586ae4 commit 2e70529

12 files changed

+35
-55
lines changed

conformance/results/mypy/dataclasses_final.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ Doesn't support Final nested inside ClassVar.
66
conformance_automated = "Fail"
77
errors_diff = """
88
Line 27: Expected 1 errors
9-
Line 38: Expected 1 errors
10-
Line 41: Expected 1 errors
119
Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value [misc]']
1210
Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]']
1311
Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int" [assert-type]']
14-
Line 37: Unexpected errors ['dataclasses_final.py:37: error: Cannot access final instance attribute "final_no_default" on class object [misc]', 'dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc]']
15-
Line 40: Unexpected errors ['dataclasses_final.py:40: error: Cannot assign to final attribute "final_with_default" [misc]']
1612
"""
1713
output = """
1814
dataclasses_final.py:16: error: Final name must be initialized with a value [misc]
@@ -22,5 +18,5 @@ dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_defau
2218
dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" [misc]
2319
dataclasses_final.py:37: error: Cannot access final instance attribute "final_no_default" on class object [misc]
2420
dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc]
25-
dataclasses_final.py:40: error: Cannot assign to final attribute "final_with_default" [misc]
21+
dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" [misc]
2622
"""

conformance/results/pyre/dataclasses_final.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ Mis-handles Final nested inside ClassVar.
44
"""
55
conformance_automated = "Fail"
66
errors_diff = """
7-
Line 38: Expected 1 errors
8-
Line 41: Expected 1 errors
97
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.']
108
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]`.']
11-
Line 37: Unexpected errors ['dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`.']
12-
Line 40: Unexpected errors ['dataclasses_final.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`.']
139
"""
1410
output = """
1511
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`.
@@ -19,5 +15,5 @@ dataclasses_final.py:27:0 Incompatible attribute type [8]: Attribute `final_clas
1915
dataclasses_final.py:35:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_no_default`.
2016
dataclasses_final.py:36:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_with_default`.
2117
dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`.
22-
dataclasses_final.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`.
18+
dataclasses_final.py:38:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`.
2319
"""

conformance/results/pyright/callables_protocol.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ callables_protocol.py:197:16 - error: Cannot access attribute "other_attribute2"
4646
  Attribute "other_attribute2" is unknown (reportAttributeAccessIssue)
4747
callables_protocol.py:238:8 - error: Expression of type "(x: int, y: str, /) -> Any" is incompatible with declared type "Proto11"
4848
  Type "(x: int, y: str, /) -> Any" is incompatible with type "(x: int, /, y: str) -> Any"
49-
    Position-only parameter mismatch; parameter "y" is not position-only
50-
    Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType)
49+
    Keyword parameter "y" is missing in source
50+
      Position-only parameter mismatch; parameter "y" is not position-only
51+
      Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType)
5152
callables_protocol.py:260:8 - error: Expression of type "(*args: Any, kwarg0: Any) -> None" is incompatible with declared type "Proto12"
5253
  Type "(*args: Any, kwarg0: Any) -> None" is incompatible with type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None"
5354
    Keyword parameter "kwarg1" is missing in source (reportAssignmentType)

conformance/results/pyright/callables_subtyping.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ callables_subtyping.py:51:21 - error: Expression of type "PosOnly2" is incompati
1414
  "PosOnly2" is incompatible with protocol "Standard2"
1515
    "__call__" is an incompatible type
1616
      Type "(b: int, a: int, /) -> None" is incompatible with type "(a: int, b: int) -> None"
17-
        Position-only parameter mismatch; parameter "a" is not position-only
18-
        Position-only parameter mismatch; parameter "b" is not position-only
19-
        Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType)
17+
        Keyword parameter "a" is missing in source
18+
        Keyword parameter "b" is missing in source
19+
          Position-only parameter mismatch; parameter "a" is not position-only
20+
          Position-only parameter mismatch; parameter "b" is not position-only
21+
          Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType)
2022
callables_subtyping.py:52:21 - error: Expression of type "KwOnly2" is incompatible with declared type "Standard2"
2123
  "KwOnly2" is incompatible with protocol "Standard2"
2224
    "__call__" is an incompatible type
@@ -94,13 +96,16 @@ callables_subtyping.py:125:22 - error: Expression of type "IntStrArgs4" is incom
9496
  "IntStrArgs4" is incompatible with protocol "Standard4"
9597
    "__call__" is an incompatible type
9698
      Type "(*args: int | str) -> None" is incompatible with type "(a: int, b: str) -> None"
99+
        Keyword parameter "a" is missing in source
97100
        Keyword parameter "b" is missing in source (reportAssignmentType)
98101
callables_subtyping.py:126:22 - error: Expression of type "StrArgs4" is incompatible with declared type "Standard4"
99102
  "StrArgs4" is incompatible with protocol "Standard4"
100103
    "__call__" is an incompatible type
101104
      Type "(a: int, /, *args: str) -> None" is incompatible with type "(a: int, b: str) -> None"
102-
        Position-only parameter mismatch; parameter "a" is not position-only
103-
        Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType)
105+
        Keyword parameter "a" is missing in source
106+
        Keyword parameter "b" is missing in source
107+
          Position-only parameter mismatch; parameter "a" is not position-only
108+
          Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType)
104109
callables_subtyping.py:151:22 - error: Expression of type "NoKwargs5" is incompatible with declared type "IntKwargs5"
105110
  "NoKwargs5" is incompatible with protocol "IntKwargs5"
106111
    "__call__" is an incompatible type
Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
1-
conformant = "Partial"
2-
notes = """
3-
Doesn't support Final nested inside ClassVar.
4-
"""
5-
conformance_automated = "Fail"
1+
conformant = "Pass"
2+
conformance_automated = "Pass"
63
errors_diff = """
7-
Line 38: Expected 1 errors
8-
Line 41: Expected 1 errors
9-
Line 18: Unexpected errors ['dataclasses_final.py:18:30 - error: "Final" is not allowed in this context', 'dataclasses_final.py:18:44 - error: Expression of type "Literal[4]" is incompatible with declared type "Final"']
10-
Line 24: Unexpected errors ['dataclasses_final.py:24:13 - error: "assert_type" mismatch: expected "int" but received "Final" (reportAssertTypeFailure)']
11-
Line 37: Unexpected errors ['dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]"']
12-
Line 40: Unexpected errors ['dataclasses_final.py:40:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]"']
134
"""
145
output = """
15-
dataclasses_final.py:18:30 - error: "Final" is not allowed in this context
16-
dataclasses_final.py:18:44 - error: Expression of type "Literal[4]" is incompatible with declared type "Final"
17-
  "Literal[4]" is incompatible with "Final" (reportAssignmentType)
18-
dataclasses_final.py:24:13 - error: "assert_type" mismatch: expected "int" but received "Final" (reportAssertTypeFailure)
19-
dataclasses_final.py:27:20 - error: Cannot assign to attribute "final_classvar" for class "type[D]"
20-
  "Literal[10]" is incompatible with "Final" (reportAttributeAccessIssue)
6+
dataclasses_final.py:27:3 - error: Cannot assign to attribute "final_classvar" for class "type[D]"
7+
  "final_classvar" is declared as Final and cannot be reassigned
8+
    Attribute "__set__" is unknown (reportAttributeAccessIssue)
219
dataclasses_final.py:35:3 - error: Cannot assign to attribute "final_no_default" for class "D"
2210
  "final_no_default" is declared as Final and cannot be reassigned
2311
    Attribute "__set__" is unknown (reportAttributeAccessIssue)
@@ -27,7 +15,7 @@ dataclasses_final.py:36:3 - error: Cannot assign to attribute "final_with_defaul
2715
dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]"
2816
  "final_no_default" is declared as Final and cannot be reassigned
2917
    Attribute "__set__" is unknown (reportAttributeAccessIssue)
30-
dataclasses_final.py:40:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]"
18+
dataclasses_final.py:38:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]"
3119
  "final_with_default" is declared as Final and cannot be reassigned
3220
    Attribute "__set__" is unknown (reportAttributeAccessIssue)
3321
"""

conformance/results/pyright/protocols_definition.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ protocols_definition.py:288:22 - error: Expression of type "Concrete5_Bad4" is i
7272
  "Concrete5_Bad4" is incompatible with protocol "Template5"
7373
    "method1" is an incompatible type
7474
      Type "(a: int, b: int, /) -> float" is incompatible with type "(a: int, b: int) -> float"
75-
        Position-only parameter mismatch; parameter "a" is not position-only
76-
        Position-only parameter mismatch; parameter "b" is not position-only
77-
        Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType)
75+
        Keyword parameter "a" is missing in source
76+
        Keyword parameter "b" is missing in source
77+
          Position-only parameter mismatch; parameter "a" is not position-only
78+
          Position-only parameter mismatch; parameter "b" is not position-only
79+
          Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType)
7880
protocols_definition.py:289:22 - error: Expression of type "Concrete5_Bad5" is incompatible with declared type "Template5"
7981
  "Concrete5_Bad5" is incompatible with protocol "Template5"
8082
    "method1" is an incompatible type

conformance/results/pyright/qualifiers_annotated.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ qualifiers_annotated.py:52:18 - error: Expected type expression but received "Li
1717
qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm)
1818
qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues)
1919
qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated"
20-
qualifiers_annotated.py:76:24 - error: Expression of type "type[int]" is incompatible with declared type "type[Any]" (reportAssignmentType)
20+
qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType)
2121
qualifiers_annotated.py:77:24 - error: Expression of type "SmallInt" is incompatible with declared type "type[Any]" (reportAssignmentType)
22-
qualifiers_annotated.py:84:7 - error: Argument of type "type[str]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType)
22+
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)
2323
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)
2424
qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue)
2525
qualifiers_annotated.py:92:1 - error: Object of type "type[Annotated]" is not callable (reportCallIssue)

conformance/results/pyright/qualifiers_final_annotation.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ qualifiers_final_annotation.py:81:8 - error: Cannot assign to attribute "DEFAULT
2525
    Attribute "__set__" is unknown (reportAttributeAccessIssue)
2626
qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues)
2727
qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context
28-
qualifiers_final_annotation.py:107:31 - error: Expression of type "Literal[1]" is incompatible with declared type "Final"
29-
  "Literal[1]" is incompatible with "Final" (reportAssignmentType)
3028
qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context
3129
qualifiers_final_annotation.py:118:9 - error: "Final" is not allowed in this context
3230
qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this context
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "pyright 1.1.363"
1+
version = "pyright 1.1.364"
22
test_duration = 1.4

conformance/results/pytype/dataclasses_final.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ Doesn't handle Final nested inside ClassVar.
55
errors_diff = """
66
Line 27: Expected 1 errors
77
Line 35: Expected 1 errors
8-
Line 38: Expected 1 errors
9-
Line 41: Expected 1 errors
8+
Line 37: Expected 1 errors
109
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]']
11-
Line 40: Unexpected errors ['File "dataclasses_final.py", line 40, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]']
1210
"""
1311
output = """
1412
File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]
1513
File "dataclasses_final.py", line 18, in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]
1614
File "dataclasses_final.py", line 36, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
17-
File "dataclasses_final.py", line 40, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
15+
File "dataclasses_final.py", line 38, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
1816
"""
1917
conformance_automated = "Fail"

0 commit comments

Comments
 (0)