From 5e66e5e6294b43389fcefaedbe8fcda728918c5b Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:33:33 +0100 Subject: [PATCH 1/7] Delete the old descriptions and status for Zuban --- conformance/results/zuban/aliases_typealiastype.toml | 5 ----- conformance/results/zuban/annotations_forward_refs.toml | 2 -- conformance/results/zuban/callables_annotation.toml | 5 ----- conformance/results/zuban/constructors_call_init.toml | 5 ----- conformance/results/zuban/constructors_call_new.toml | 6 ------ conformance/results/zuban/constructors_call_type.toml | 4 ---- conformance/results/zuban/constructors_callable.toml | 7 ------- conformance/results/zuban/dataclasses_final.toml | 5 ----- conformance/results/zuban/dataclasses_hash.toml | 4 ---- conformance/results/zuban/dataclasses_slots.toml | 4 ---- .../results/zuban/dataclasses_transform_converter.toml | 4 ---- conformance/results/zuban/enums_expansion.toml | 2 -- conformance/results/zuban/enums_member_values.toml | 2 -- conformance/results/zuban/enums_members.toml | 4 ---- conformance/results/zuban/generics_base_class.toml | 4 ---- conformance/results/zuban/generics_defaults.toml | 6 ------ conformance/results/zuban/generics_scoping.toml | 4 ---- conformance/results/zuban/generics_self_usage.toml | 3 --- .../results/zuban/generics_syntax_infer_variance.toml | 4 ---- conformance/results/zuban/generics_syntax_scoping.toml | 4 ---- conformance/results/zuban/generics_typevartuple_args.toml | 4 ---- .../results/zuban/generics_typevartuple_basic.toml | 5 ----- conformance/results/zuban/generics_upper_bound.toml | 4 ---- conformance/results/zuban/generics_variance.toml | 4 ---- conformance/results/zuban/historical_positional.toml | 6 ------ conformance/results/zuban/literals_interactions.toml | 4 ---- conformance/results/zuban/namedtuples_define_class.toml | 2 -- conformance/results/zuban/overloads_evaluation.toml | 8 -------- conformance/results/zuban/protocols_definition.toml | 5 ----- .../results/zuban/protocols_runtime_checkable.toml | 4 ---- .../results/zuban/qualifiers_final_annotation.toml | 5 ----- conformance/results/zuban/tuples_type_compat.toml | 1 - conformance/results/zuban/typeddicts_alt_syntax.toml | 3 --- .../results/zuban/typeddicts_readonly_inheritance.toml | 6 ------ conformance/results/zuban/typeddicts_readonly_update.toml | 4 ---- 35 files changed, 149 deletions(-) diff --git a/conformance/results/zuban/aliases_typealiastype.toml b/conformance/results/zuban/aliases_typealiastype.toml index 88fb5f8a5..c6ada7b73 100644 --- a/conformance/results/zuban/aliases_typealiastype.toml +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index 5ca6e3aee..2e6949f35 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -1,8 +1,6 @@ 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 = """ diff --git a/conformance/results/zuban/callables_annotation.toml b/conformance/results/zuban/callables_annotation.toml index c365d70fe..ed5407156 100644 --- a/conformance/results/zuban/callables_annotation.toml +++ b/conformance/results/zuban/callables_annotation.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml index e488f058e..8c2b2ea5e 100644 --- a/conformance/results/zuban/constructors_call_init.toml +++ b/conformance/results/zuban/constructors_call_init.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml index 12f5c828b..fcfe9283e 100644 --- a/conformance/results/zuban/constructors_call_new.toml +++ b/conformance/results/zuban/constructors_call_new.toml @@ -1,9 +1,3 @@ -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 148: Expected 1 errors diff --git a/conformance/results/zuban/constructors_call_type.toml b/conformance/results/zuban/constructors_call_type.toml index 7ba573760..5a1eb586c 100644 --- a/conformance/results/zuban/constructors_call_type.toml +++ b/conformance/results/zuban/constructors_call_type.toml @@ -1,7 +1,3 @@ -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 diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml index 51b00c6f9..1f110b789 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -1,10 +1,3 @@ -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 129: Expected 1 errors diff --git a/conformance/results/zuban/dataclasses_final.toml b/conformance/results/zuban/dataclasses_final.toml index bbe33fd0d..969b2c71a 100644 --- a/conformance/results/zuban/dataclasses_final.toml +++ b/conformance/results/zuban/dataclasses_final.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/dataclasses_hash.toml b/conformance/results/zuban/dataclasses_hash.toml index 1e0314518..a7f264ee3 100644 --- a/conformance/results/zuban/dataclasses_hash.toml +++ b/conformance/results/zuban/dataclasses_hash.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not report when dataclass is not compatible with Hashable protocol. -""" conformance_automated = "Fail" errors_diff = """ Line 15: Expected 1 errors diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml index ecf43ca21..62823a222 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -1,7 +1,3 @@ -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 diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index fc295f946..fcf312fc2 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Converters are fully supported, failed to match generic overloads against other generics -""" conformance_automated = "Fail" errors_diff = """ Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type]'] diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 699dbd1c4..66fb8eb8a 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -1,6 +1,4 @@ -conformant = "Partial" notes = """ -Improperly applies narrowing to Flag subclass. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml index 95ead33c4..676265702 100644 --- a/conformance/results/zuban/enums_member_values.toml +++ b/conformance/results/zuban/enums_member_values.toml @@ -1,6 +1,4 @@ -conformant = "Partial" notes = """ -Does not enforce declared type of `_value_`. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml index 0a625e68a..de30afb3d 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -1,8 +1,4 @@ -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 = """ diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml index c8166fd86..d7abad721 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not detect inconsistent type variable ordering in multi-inheritance. -""" conformance_automated = "Fail" errors_diff = """ Line 98: Expected 1 errors diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index f0bef676e..bda9db1ae 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -1,9 +1,3 @@ -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 143: Expected 1 errors diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml index 19c63482e..85a40ae90 100644 --- a/conformance/results/zuban/generics_scoping.toml +++ b/conformance/results/zuban/generics_scoping.toml @@ -1,7 +1,3 @@ -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 [misc]'] diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml index ef5859e87..f856dae15 100644 --- a/conformance/results/zuban/generics_self_usage.toml +++ b/conformance/results/zuban/generics_self_usage.toml @@ -1,6 +1,3 @@ -conformant = "Partial" -notes = """ -Does not detect invalid Self when Self is not properly bound""" conformance_automated = "Fail" errors_diff = """ Line 82: Expected 1 errors diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index e1207f927..86e9b44e7 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Final is handled a bit different (questionable if this is an issue) -""" conformance_automated = "Fail" 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]'] diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index 6f4596518..ea9317569 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not following runtime scoping rules for type parameters in all cases. -""" conformance_automated = "Fail" errors_diff = """ Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] diff --git a/conformance/results/zuban/generics_typevartuple_args.toml b/conformance/results/zuban/generics_typevartuple_args.toml index e3d4632d5..8621ea47b 100644 --- a/conformance/results/zuban/generics_typevartuple_args.toml +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not enforce that tuples captured by TypeVarTuple are same type. -""" conformance_automated = "Fail" errors_diff = """ Line 75: Expected 1 errors diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml index 50dd49ad2..2f9a306ad 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/generics_upper_bound.toml b/conformance/results/zuban/generics_upper_bound.toml index c1b62c749..a6f5b35ac 100644 --- a/conformance/results/zuban/generics_upper_bound.toml +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not reject use of type variable within an upper bound. -""" conformance_automated = "Fail" errors_diff = """ Line 24: Expected 1 errors diff --git a/conformance/results/zuban/generics_variance.toml b/conformance/results/zuban/generics_variance.toml index b051fcdbb..ab52f0555 100644 --- a/conformance/results/zuban/generics_variance.toml +++ b/conformance/results/zuban/generics_variance.toml @@ -1,7 +1,3 @@ -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 diff --git a/conformance/results/zuban/historical_positional.toml b/conformance/results/zuban/historical_positional.toml index 5d5888464..97372586b 100644 --- a/conformance/results/zuban/historical_positional.toml +++ b/conformance/results/zuban/historical_positional.toml @@ -1,9 +1,3 @@ -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 diff --git a/conformance/results/zuban/literals_interactions.toml b/conformance/results/zuban/literals_interactions.toml index 40c6f282b..2ed79e98d 100644 --- a/conformance/results/zuban/literals_interactions.toml +++ b/conformance/results/zuban/literals_interactions.toml @@ -1,7 +1,3 @@ -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\\']" [arg-type]'] diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml index 67acdb24b..5e15f2c5b 100644 --- a/conformance/results/zuban/namedtuples_define_class.toml +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -1,6 +1,4 @@ -conformant = "Partial" notes = """ -Does not reject override of named tuple attribute in child class. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml index 300c1fff5..c1f2a28d6 100644 --- a/conformance/results/zuban/overloads_evaluation.toml +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -1,11 +1,3 @@ -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 135: Unexpected errors ['overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml index b4ca17e49..e6c7b9cf3 100644 --- a/conformance/results/zuban/protocols_definition.toml +++ b/conformance/results/zuban/protocols_definition.toml @@ -1,8 +1,3 @@ -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 diff --git a/conformance/results/zuban/protocols_runtime_checkable.toml b/conformance/results/zuban/protocols_runtime_checkable.toml index aec23be68..a43f1b21f 100644 --- a/conformance/results/zuban/protocols_runtime_checkable.toml +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not report unsafe overlap for runtime_checkable protocol. -""" conformance_automated = "Fail" errors_diff = """ Line 88: Expected 1 errors diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml index 98d471086..a251b50c4 100644 --- a/conformance/results/zuban/qualifiers_final_annotation.toml +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -1,8 +1,3 @@ -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 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..407417496 100644 --- a/conformance/results/zuban/typeddicts_readonly_inheritance.toml +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -1,9 +1,3 @@ -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 [misc]'] diff --git a/conformance/results/zuban/typeddicts_readonly_update.toml b/conformance/results/zuban/typeddicts_readonly_update.toml index 54c32eb20..c614899ef 100644 --- a/conformance/results/zuban/typeddicts_readonly_update.toml +++ b/conformance/results/zuban/typeddicts_readonly_update.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Incorrectly allows update of ReadOnly item. -""" conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors From deaddd8738707bad7583450b847b6ba8281f474c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:36:08 +0100 Subject: [PATCH 2/7] Change the flags for Zuban --- conformance/src/type_checker.py | 3 --- 1 file changed, 3 deletions(-) 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") From bdd500685b77e4fb5e9db4356643d42c0ead7943 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:38:05 +0100 Subject: [PATCH 3/7] Make tests a bit easier to work with for Zuban --- conformance/tests/generics_base_class.py | 2 +- conformance/tests/specialtypes_never.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/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 593d74d38540982863229639c95eb21017028f35 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:39:33 +0100 Subject: [PATCH 4/7] Make it possible to infer more precise types in overloads_evaluation --- conformance/tests/overloads_evaluation.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/conformance/tests/overloads_evaluation.py b/conformance/tests/overloads_evaluation.py index 518b864a5..1d7f13854 100644 --- a/conformance/tests/overloads_evaluation.py +++ b/conformance/tests/overloads_evaluation.py @@ -262,7 +262,8 @@ def check_example4(v1: list[Any], v2: Any) -> None: assert_type(ret1, list[int]) ret2 = example4(v2, 1) - assert_type(ret2, Any) + assert_type(ret2, Any) # E[example4] + assert_type(ret2, list[Any]) # E[example4] @overload @@ -278,7 +279,8 @@ def example5(obj: Any) -> list[Any]: def check_example5(b: list[Any]) -> None: - assert_type(example5(b), Any) + assert_type(example5(b), Any) # E[example5] + assert_type(example5(b), list[Any]) # E[example5] @overload @@ -344,4 +346,5 @@ def check_example7(v1: list[Any], v2: Any) -> None: assert_type(ret2, list[str]) ret3 = example7(v1, v2) - assert_type(ret3, Any) + assert_type(ret3, Any) # E[example7] + assert_type(ret3, list[Any]) # E[example7] From 04c0df5eaa12a31893d2eef80f071df2cbb6998f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:41:52 +0100 Subject: [PATCH 5/7] Methods may be inferred as callables with a 'Self' TypeVar that has a bound of the class --- conformance/tests/generics_defaults.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) From 8cfbc5ae96fb4764d3bc205b5d873ab335b9223b Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 01:43:43 +0100 Subject: [PATCH 6/7] Allow type checkers to disallow TypeVars in a nested class' __init__ --- conformance/tests/generics_scoping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ab19cfd8743e03439c45fa58c6cff66e89e819a0 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 Dec 2025 10:12:43 +0100 Subject: [PATCH 7/7] Run conformance tests --- .../results/mypy/generics_defaults.toml | 2 - .../results/mypy/overloads_evaluation.toml | 11 +-- .../results/mypy/specialtypes_never.toml | 8 +- conformance/results/mypy/version.toml | 2 +- .../results/pyrefly/generics_defaults.toml | 8 +- .../results/pyrefly/overloads_evaluation.toml | 3 + .../results/pyrefly/protocols_explicit.toml | 9 +-- .../results/pyrefly/specialtypes_never.toml | 8 +- conformance/results/pyrefly/version.toml | 2 +- .../results/pyright/overloads_evaluation.toml | 9 ++- .../results/pyright/specialtypes_never.toml | 4 +- conformance/results/results.html | 74 +++++++++---------- .../results/zuban/aliases_typealiastype.toml | 6 +- .../zuban/annotations_forward_refs.toml | 9 +-- .../results/zuban/callables_annotation.toml | 16 ++-- .../results/zuban/constructors_call_init.toml | 7 +- .../results/zuban/constructors_call_new.toml | 22 +----- .../results/zuban/constructors_call_type.toml | 6 +- .../results/zuban/constructors_callable.toml | 37 ++-------- .../results/zuban/dataclasses_final.toml | 10 +-- .../results/zuban/dataclasses_hash.toml | 6 +- .../results/zuban/dataclasses_slots.toml | 4 +- .../dataclasses_transform_converter.toml | 4 +- .../results/zuban/enums_expansion.toml | 7 +- .../results/zuban/enums_member_values.toml | 4 +- conformance/results/zuban/enums_members.toml | 12 +-- .../results/zuban/generics_base_class.toml | 6 +- .../results/zuban/generics_defaults.toml | 9 +-- .../results/zuban/generics_scoping.toml | 3 +- .../results/zuban/generics_self_usage.toml | 11 ++- .../zuban/generics_syntax_declarations.toml | 2 +- .../zuban/generics_syntax_infer_variance.toml | 6 +- .../zuban/generics_syntax_scoping.toml | 25 +------ .../zuban/generics_typevartuple_args.toml | 6 +- .../zuban/generics_typevartuple_basic.toml | 16 ++-- .../results/zuban/generics_upper_bound.toml | 4 +- .../results/zuban/generics_variance.toml | 14 ++-- .../results/zuban/historical_positional.toml | 8 +- .../results/zuban/literals_interactions.toml | 6 +- .../zuban/namedtuples_define_class.toml | 6 +- .../results/zuban/overloads_evaluation.toml | 29 +------- .../results/zuban/protocols_definition.toml | 23 +++++- .../zuban/protocols_runtime_checkable.toml | 10 ++- .../zuban/qualifiers_final_annotation.toml | 11 +-- .../results/zuban/specialtypes_never.toml | 9 ++- .../typeddicts_readonly_inheritance.toml | 12 +-- .../zuban/typeddicts_readonly_update.toml | 4 +- conformance/results/zuban/version.toml | 2 +- 48 files changed, 188 insertions(+), 324 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/overloads_evaluation.toml b/conformance/results/mypy/overloads_evaluation.toml index 4ddeaca2d..abfe1ec1d 100644 --- a/conformance/results/mypy/overloads_evaluation.toml +++ b/conformance/results/mypy/overloads_evaluation.toml @@ -14,10 +14,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 305: Unexpected errors ['overloads_evaluation.py:305: 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] @@ -47,7 +44,7 @@ overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 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:282: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:305: error: Expression is of type "Any", not "float" [assert-type] +overloads_evaluation.py:349: error: Expression is of type "list[Any]", not "Any" [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/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 46549b266..ffc60bab1 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -6,4 +6,7 @@ ERROR overloads_evaluation.py:38:11-13: No matching overload found for function 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:116: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:266:16-33: assert_type(Any, list[Any]) failed [assert-type] +ERROR overloads_evaluation.py:283:16-40: assert_type(Any, list[Any]) failed [assert-type] +ERROR overloads_evaluation.py:350:16-33: assert_type(Any, list[Any]) 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/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..c10f8526e 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.45.2" +version = "pyrefly 0.46.0" diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index 7b41dc4e1..0e2b07154 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -4,7 +4,9 @@ Does not evaluate Any in some cases where overload is ambiguous. """ 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)'] +Lines 282, 283: Expected exactly one error (tag 'example5') +Line 282: Unexpected errors ['overloads_evaluation.py:282:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure)'] +Line 283: Unexpected errors ['overloads_evaluation.py:283:17 - error: "assert_type" mismatch: expected "list[Any]" but received "list[int]" (reportAssertTypeFailure)'] """ output = """ overloads_evaluation.py:38:1 - error: No overloads for "example1_1" match the provided arguments @@ -20,5 +22,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:266:17 - error: "assert_type" mismatch: expected "list[Any]" but received "Unknown" (reportAssertTypeFailure) +overloads_evaluation.py:282:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure) +overloads_evaluation.py:283:17 - error: "assert_type" mismatch: expected "list[Any]" but received "list[int]" (reportAssertTypeFailure) +overloads_evaluation.py:350:17 - error: "assert_type" mismatch: expected "list[Any]" but received "Unknown" (reportAssertTypeFailure) """ 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..75d308cce 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,13 +158,13 @@

Python Type System Conformance Test Results

- - - - + @@ -239,7 +239,7 @@

Python Type System Conformance Test Results

- + @@ -251,7 +251,7 @@

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,7 +536,7 @@

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.0
pyrefly 0.45.2
+
pyrefly 0.46.0
@@ -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

Pass
Partial

Defaults are not bound by attribute access

     generics_defaults_referential
     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
     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 c6ada7b73..082a9f47b 100644 --- a/conformance/results/zuban/aliases_typealiastype.toml +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -1,14 +1,12 @@ -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 2e6949f35..544569aad 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -4,16 +4,14 @@ Incorrectly generates error for quoted type defined in class scope. """ 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[...]"? @@ -41,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 ed5407156..01f74e7ed 100644 --- a/conformance/results/zuban/callables_annotation.toml +++ b/conformance/results/zuban/callables_annotation.toml @@ -1,7 +1,5 @@ -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] @@ -19,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 8c2b2ea5e..a642bef3e 100644 --- a/conformance/results/zuban/constructors_call_init.toml +++ b/conformance/results/zuban/constructors_call_init.toml @@ -1,10 +1,11 @@ -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 fcfe9283e..c3407c9ad 100644 --- a/conformance/results/zuban/constructors_call_new.toml +++ b/conformance/results/zuban/constructors_call_new.toml @@ -1,25 +1,7 @@ -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 5a1eb586c..45cc8aeb0 100644 --- a/conformance/results/zuban/constructors_call_type.toml +++ b/conformance/results/zuban/constructors_call_type.toml @@ -1,13 +1,13 @@ -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 1f110b789..a59ffe662 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -1,15 +1,5 @@ -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" @@ -21,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 969b2c71a..b59d3cac0 100644 --- a/conformance/results/zuban/dataclasses_final.toml +++ b/conformance/results/zuban/dataclasses_final.toml @@ -1,14 +1,8 @@ -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 a7f264ee3..210b7f0bd 100644 --- a/conformance/results/zuban/dataclasses_hash.toml +++ b/conformance/results/zuban/dataclasses_hash.toml @@ -1,7 +1,7 @@ -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 62823a222..6090819e6 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -1,9 +1,9 @@ -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 fcf312fc2..0b0764c98 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -1,11 +1,9 @@ -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 66fb8eb8a..4bda0b4dd 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -1,10 +1,9 @@ notes = """ """ -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 676265702..9705e064b 100644 --- a/conformance/results/zuban/enums_member_values.toml +++ b/conformance/results/zuban/enums_member_values.toml @@ -1,12 +1,12 @@ notes = """ """ -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 de30afb3d..f73b24d79 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -1,20 +1,16 @@ notes = """ """ -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 d7abad721..c6f007321 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -1,14 +1,12 @@ -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 bda9db1ae..1eb17cae2 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -1,8 +1,5 @@ -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] @@ -10,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 85a40ae90..92f6073df 100644 --- a/conformance/results/zuban/generics_scoping.toml +++ b/conformance/results/zuban/generics_scoping.toml @@ -1,6 +1,5 @@ -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 f856dae15..7e6d56776 100644 --- a/conformance/results/zuban/generics_self_usage.toml +++ b/conformance/results/zuban/generics_self_usage.toml @@ -1,19 +1,18 @@ -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 86e9b44e7..36d8e5ac7 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -1,7 +1,5 @@ -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] @@ -10,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 ea9317569..f2fdbd44b 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -1,39 +1,16 @@ -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 8621ea47b..f2d5d1ccf 100644 --- a/conformance/results/zuban/generics_typevartuple_args.toml +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -1,7 +1,5 @@ -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] @@ -12,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 2f9a306ad..7cea1a8b1 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -1,12 +1,5 @@ -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] @@ -14,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 a6f5b35ac..4dffa2252 100644 --- a/conformance/results/zuban/generics_upper_bound.toml +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -1,8 +1,8 @@ -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 ab52f0555..02c8a1f9c 100644 --- a/conformance/results/zuban/generics_variance.toml +++ b/conformance/results/zuban/generics_variance.toml @@ -1,11 +1,5 @@ -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] @@ -13,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 97372586b..78a8b6aa0 100644 --- a/conformance/results/zuban/historical_positional.toml +++ b/conformance/results/zuban/historical_positional.toml @@ -1,11 +1,9 @@ -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 2ed79e98d..242baa2f2 100644 --- a/conformance/results/zuban/literals_interactions.toml +++ b/conformance/results/zuban/literals_interactions.toml @@ -1,13 +1,9 @@ -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 5e15f2c5b..e2e3edeb4 100644 --- a/conformance/results/zuban/namedtuples_define_class.toml +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -1,9 +1,7 @@ notes = """ """ -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] @@ -14,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 c1f2a28d6..9266e1aa0 100644 --- a/conformance/results/zuban/overloads_evaluation.toml +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -1,15 +1,5 @@ -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] @@ -26,20 +16,7 @@ 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] +overloads_evaluation.py:282: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:349: 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 e6c7b9cf3..a0316e0ea 100644 --- a/conformance/results/zuban/protocols_definition.toml +++ b/conformance/results/zuban/protocols_definition.toml @@ -1,8 +1,5 @@ -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] @@ -34,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 a43f1b21f..faa978c8e 100644 --- a/conformance/results/zuban/protocols_runtime_checkable.toml +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -1,8 +1,5 @@ -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] @@ -10,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 a251b50c4..32a15ea44 100644 --- a/conformance/results/zuban/qualifiers_final_annotation.toml +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -1,9 +1,5 @@ -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] @@ -11,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] @@ -23,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/typeddicts_readonly_inheritance.toml b/conformance/results/zuban/typeddicts_readonly_inheritance.toml index 407417496..d40209993 100644 --- a/conformance/results/zuban/typeddicts_readonly_inheritance.toml +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -1,25 +1,15 @@ -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 c614899ef..c5069c3d5 100644 --- a/conformance/results/zuban/typeddicts_readonly_update.toml +++ b/conformance/results/zuban/typeddicts_readonly_update.toml @@ -1,6 +1,6 @@ -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..526d8bc62 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.3.0" +version = "zuban 0.4.0"