From 0151347fd79f89f1259b45aa5381020b59a6fdbd Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 11 Aug 2025 15:30:25 +0200 Subject: [PATCH 1/5] Add the Zuban type checker code --- conformance/src/main.py | 2 +- conformance/src/reporting.py | 12 +++++- conformance/src/type_checker.py | 69 +++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/conformance/src/main.py b/conformance/src/main.py index 4c9342a68..484688b77 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -235,7 +235,7 @@ def update_type_checker_info( existing_info["version"] = type_checker.get_version() if not skip_timing: - existing_info["test_duration"] = round(test_duration, 1) + existing_info["test_duration"] = round(test_duration, 2) version_file.parent.mkdir(parents=True, exist_ok=True) with open(version_file, "w") as f: diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index 1c4243709..c17687240 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -50,7 +50,11 @@ def generate_summary_html(root_dir: Path) -> str: summary_html.append(f"
{version}
") if test_duration is not None: - summary_html.append(f"
{test_duration:.1f}sec
") + if test_duration < 1: + duration = f"{test_duration:.2f}" + else: + duration = f"{test_duration:.1f}" + summary_html.append(f"
{duration}sec
") summary_html.append("") summary_html.append("") @@ -90,6 +94,12 @@ def generate_summary_html(root_dir: Path) -> str: raw_notes = results.get("notes", "").strip() conformance = results.get("conformant", "Unknown") + if conformance == "Unknown": + # Try to look up the automated test results and use + # that if the test passes + automated = results.get("conformance_automated") + if automated == "Pass": + conformance = "Pass" notes = "".join( [f"

{note}

" for note in raw_notes.split("\n")] ) diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 48c869c4f..55be2bece 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -273,9 +273,78 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors +class ZubanLSTypeChecker(MypyTypeChecker): + @property + def name(self) -> str: + return "zuban" + + def install(self) -> bool: + try: + # Uninstall any existing version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "zuban", "-y"], + check=True, + ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "zuban"], + check=True, + ) + + # Run "mypy --version" to ensure that it's installed and to work + # around timing issues caused by malware scanners on some systems. + self.get_version() + + return True + except CalledProcessError: + print("Unable to install zuban") + return False + + def get_version(self) -> str: + proc = run(["zmypy", "--version"], stdout=PIPE, text=True) + return proc.stdout.strip().replace("zmypy", "zuban") + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + command = [ + "zmypy", + ".", + "--disable-error-code", + "empty-body", + "--enable-error-code", + "deprecated", + "--no-warn-unreachable", + "--no-mypy-compatible", + ] + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") + lines = proc.stdout.split("\n") + + # Add results to a dictionary keyed by the file name. + results_dict: dict[str, str] = {} + for line in lines: + file_name = line.split(":")[0].strip() + results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" + + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + # narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument [valid-type] + line_to_errors: dict[int, list[str]] = {} + for line in output: + if line.count(":") < 3: + continue + _, lineno, kind, _ = line.split(":", maxsplit=3) + kind = kind.strip() + if kind != "error": + continue + line_to_errors.setdefault(int(lineno), []).append(line) + return line_to_errors + + TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), *([] if os.name == "nt" else [PyreTypeChecker()]), + ZubanLSTypeChecker(), ) From 2d71f81f68c663a0ed0592128eaef4287a5e6292 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 11 Aug 2025 15:33:16 +0200 Subject: [PATCH 2/5] Change tests where the lines might differ or errors could be optional --- conformance/tests/annotations_generators.py | 4 ++-- conformance/tests/classes_classvar.py | 2 +- conformance/tests/overloads_definitions.py | 2 +- conformance/tests/overloads_definitions_stub.pyi | 6 +++--- conformance/tests/qualifiers_annotated.py | 2 +- conformance/tests/typeddicts_alt_syntax.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conformance/tests/annotations_generators.py b/conformance/tests/annotations_generators.py index 2def79eaa..32761b040 100644 --- a/conformance/tests/annotations_generators.py +++ b/conformance/tests/annotations_generators.py @@ -84,12 +84,12 @@ def generator7() -> Iterator[dict[str, int]]: def generator8() -> int: # E: incompatible return type - yield None # E + yield None # E? error was already raised above return 0 async def generator9() -> int: # E: incompatible return type - yield None # E + yield None # E? error was already raised above class IntIterator(Protocol): diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 2f6ed04fb..3f94fe5a6 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -63,7 +63,7 @@ class ClassA(Generic[T, P]): good4: ClassVar = 3.1 # > If the `ClassVar` qualifier is used without any assigned value, the type # > should be inferred as `Any`: - good5: ClassVar #E? Type checkers may error on uninitialized ClassVar + good5: ClassVar # E?: Type checkers may error on uninitialized ClassVar good6: Annotated[ClassVar[list[int]], ""] = [] def method1(self, a: ClassVar[int]): # E: ClassVar not allowed here diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index a1bcd030b..8870cd3e6 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -119,7 +119,7 @@ def final_method(self, x: int | str) -> int | str: ... # The @final decorator should not be on one of the overloads: @overload # E[invalid_final] @final should be on implementation only - @final + @final # E[invalid_final] def invalid_final(self, x: int) -> int: # E[invalid_final] ... diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi index a399ec553..b9bd7eb61 100644 --- a/conformance/tests/overloads_definitions_stub.pyi +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -69,7 +69,7 @@ class Base: def invalid_final(self, x: int) -> int: # E[invalid_final] ... @overload # E[invalid_final] - @final + @final # E[invalid_final] def invalid_final(self, x: str) -> str: # E[invalid_final] ... @overload @@ -82,7 +82,7 @@ class Base: def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] ... @overload # E[invalid_final_2] - @final + @final # E[invalid_final_2] def invalid_final_2(self, x: str) -> str: ... # E[invalid_final_2] # These methods are just here for the @override test below. We use an @@ -143,7 +143,7 @@ class Child(Base): # E[override-final] @overload # E[override_impl]: @override should appear only on first overload def to_override(self, x: int) -> int: ... @overload - @override + @override # E[override_impl]: @override should appear only on first overload def to_override( # E[override_impl]: @override should appear only on first overload self, x: str ) -> str: # E[override_impl]: @override should appear only on first overload diff --git a/conformance/tests/qualifiers_annotated.py b/conformance/tests/qualifiers_annotated.py index adc4f78db..a24814136 100644 --- a/conformance/tests/qualifiers_annotated.py +++ b/conformance/tests/qualifiers_annotated.py @@ -116,6 +116,6 @@ class ClassC(TypedDict): TA1: TypeAlias = Annotated[int | str, ""] TA2 = Annotated[Literal[1, 2], ""] -T = TypeVar("T") +T = TypeVar("T") # E?: T is already defined TA3 = Annotated[T, ""] diff --git a/conformance/tests/typeddicts_alt_syntax.py b/conformance/tests/typeddicts_alt_syntax.py index a08b10555..93d1b4334 100644 --- a/conformance/tests/typeddicts_alt_syntax.py +++ b/conformance/tests/typeddicts_alt_syntax.py @@ -42,4 +42,4 @@ movie2: Movie2 movie2 = {"name": "Blade Runner", "year": 1982} # E?: May generate errors if keyword-argument syntax is unsupported -movie2 = {"name": "Blade Runner", "year": ""} # E: Incorrect type for year +movie2 = {"name": "Blade Runner", "year": ""} # E?: Incorrect type for year From f2fdebb987ac82aa9ffd1e2391c12d10dd2ec79e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 11 Aug 2025 15:33:30 +0200 Subject: [PATCH 3/5] Add the results for ZubanLS --- conformance/results/results.html | 190 +++++++++++++++--- .../results/zuban/aliases_explicit.toml | 29 +++ .../results/zuban/aliases_implicit.toml | 41 ++++ .../results/zuban/aliases_newtype.toml | 21 ++ .../results/zuban/aliases_recursive.toml | 17 ++ .../results/zuban/aliases_type_statement.toml | 35 ++++ .../results/zuban/aliases_typealiastype.toml | 38 ++++ .../results/zuban/aliases_variance.toml | 9 + .../results/zuban/annotations_coroutines.toml | 5 + .../zuban/annotations_forward_refs.toml | 52 +++++ .../results/zuban/annotations_generators.toml | 16 ++ .../results/zuban/annotations_methods.toml | 6 + .../results/zuban/annotations_typeexpr.toml | 24 +++ .../results/zuban/callables_annotation.toml | 36 ++++ .../results/zuban/callables_kwargs.toml | 23 +++ .../results/zuban/callables_protocol.toml | 24 +++ .../results/zuban/callables_subtyping.toml | 187 +++++++++++++++++ .../results/zuban/classes_classvar.toml | 27 +++ .../results/zuban/classes_override.toml | 10 + .../results/zuban/constructors_call_init.toml | 15 ++ .../zuban/constructors_call_metaclass.toml | 18 ++ .../results/zuban/constructors_call_new.toml | 31 +++ .../results/zuban/constructors_call_type.toml | 17 ++ .../results/zuban/constructors_callable.toml | 59 ++++++ .../zuban/constructors_consistency.toml | 5 + .../zuban/dataclasses_descriptors.toml | 5 + .../results/zuban/dataclasses_final.toml | 21 ++ .../results/zuban/dataclasses_frozen.toml | 9 + .../results/zuban/dataclasses_hash.toml | 11 + .../zuban/dataclasses_inheritance.toml | 7 + .../results/zuban/dataclasses_kwonly.toml | 8 + .../results/zuban/dataclasses_order.toml | 6 + .../results/zuban/dataclasses_postinit.toml | 13 ++ .../results/zuban/dataclasses_slots.toml | 14 ++ .../zuban/dataclasses_transform_class.toml | 11 + .../dataclasses_transform_converter.toml | 50 +++++ .../zuban/dataclasses_transform_field.toml | 7 + .../zuban/dataclasses_transform_func.toml | 11 + .../zuban/dataclasses_transform_meta.toml | 11 + .../results/zuban/dataclasses_usage.toml | 16 ++ .../results/zuban/directives_assert_type.toml | 11 + .../results/zuban/directives_cast.toml | 8 + .../results/zuban/directives_deprecated.toml | 18 ++ .../zuban/directives_no_type_check.toml | 7 + .../results/zuban/directives_reveal_type.toml | 11 + .../zuban/directives_type_checking.toml | 5 + .../results/zuban/directives_type_ignore.toml | 14 ++ .../zuban/directives_type_ignore_file1.toml | 5 + .../zuban/directives_type_ignore_file2.toml | 6 + .../zuban/directives_version_platform.toml | 9 + .../results/zuban/enums_behaviors.toml | 8 + .../results/zuban/enums_definition.toml | 6 + .../results/zuban/enums_expansion.toml | 13 ++ .../results/zuban/enums_member_names.toml | 6 + .../results/zuban/enums_member_values.toml | 14 ++ conformance/results/zuban/enums_members.toml | 30 +++ .../zuban/exceptions_context_managers.toml | 5 + .../results/zuban/generics_base_class.toml | 18 ++ conformance/results/zuban/generics_basic.toml | 18 ++ .../results/zuban/generics_defaults.toml | 18 ++ .../zuban/generics_defaults_referential.toml | 12 ++ .../generics_defaults_specialization.toml | 7 + .../zuban/generics_paramspec_basic.toml | 22 ++ .../zuban/generics_paramspec_components.toml | 27 +++ .../zuban/generics_paramspec_semantics.toml | 15 ++ .../generics_paramspec_specialization.toml | 10 + .../results/zuban/generics_scoping.toml | 31 +++ .../results/zuban/generics_self_advanced.toml | 13 ++ .../zuban/generics_self_attributes.toml | 7 + .../results/zuban/generics_self_basic.toml | 8 + .../zuban/generics_self_protocols.toml | 17 ++ .../results/zuban/generics_self_usage.toml | 22 ++ .../zuban/generics_syntax_compatibility.toml | 7 + .../zuban/generics_syntax_declarations.toml | 17 ++ .../zuban/generics_syntax_infer_variance.toml | 67 ++++++ .../zuban/generics_syntax_scoping.toml | 43 ++++ .../results/zuban/generics_type_erasure.toml | 20 ++ .../zuban/generics_typevartuple_args.toml | 19 ++ .../zuban/generics_typevartuple_basic.toml | 31 +++ .../zuban/generics_typevartuple_callable.toml | 6 + .../zuban/generics_typevartuple_concat.toml | 5 + .../generics_typevartuple_overloads.toml | 5 + .../generics_typevartuple_specialization.toml | 12 ++ .../zuban/generics_typevartuple_unpack.toml | 6 + .../results/zuban/generics_upper_bound.toml | 13 ++ .../results/zuban/generics_variance.toml | 22 ++ .../zuban/generics_variance_inference.toml | 28 +++ .../results/zuban/historical_positional.toml | 17 ++ .../results/zuban/literals_interactions.toml | 17 ++ .../results/zuban/literals_literalstring.toml | 22 ++ .../zuban/literals_parameterizations.toml | 24 +++ .../results/zuban/literals_semantics.toml | 9 + .../zuban/namedtuples_define_class.toml | 21 ++ .../zuban/namedtuples_define_functional.toml | 17 ++ .../zuban/namedtuples_type_compat.toml | 7 + .../results/zuban/namedtuples_usage.toml | 13 ++ .../results/zuban/narrowing_typeguard.toml | 9 + .../results/zuban/narrowing_typeis.toml | 14 ++ .../results/zuban/overloads_basic.toml | 9 + .../results/zuban/overloads_consistency.toml | 7 + .../results/zuban/overloads_definitions.toml | 17 ++ .../zuban/overloads_definitions_stub.toml | 13 ++ .../results/zuban/overloads_evaluation.toml | 53 +++++ .../zuban/protocols_class_objects.toml | 25 +++ .../results/zuban/protocols_definition.toml | 60 ++++++ .../results/zuban/protocols_explicit.toml | 16 ++ .../results/zuban/protocols_generic.toml | 39 ++++ .../results/zuban/protocols_merging.toml | 15 ++ .../results/zuban/protocols_modules.toml | 15 ++ .../results/zuban/protocols_recursive.toml | 5 + .../zuban/protocols_runtime_checkable.toml | 17 ++ conformance/results/zuban/protocols_self.toml | 5 + .../results/zuban/protocols_subtyping.toml | 34 ++++ .../results/zuban/protocols_variance.toml | 14 ++ .../results/zuban/qualifiers_annotated.toml | 28 +++ .../zuban/qualifiers_final_annotation.toml | 41 ++++ .../zuban/qualifiers_final_decorator.toml | 20 ++ .../results/zuban/specialtypes_any.toml | 5 + .../results/zuban/specialtypes_never.toml | 10 + .../results/zuban/specialtypes_none.toml | 8 + .../zuban/specialtypes_promotions.toml | 6 + .../results/zuban/specialtypes_type.toml | 14 ++ .../results/zuban/tuples_type_compat.toml | 37 ++++ .../results/zuban/tuples_type_form.toml | 16 ++ .../results/zuban/tuples_unpacked.toml | 10 + .../results/zuban/typeddicts_alt_syntax.toml | 13 ++ .../zuban/typeddicts_class_syntax.toml | 10 + .../results/zuban/typeddicts_final.toml | 5 + .../results/zuban/typeddicts_inheritance.toml | 8 + .../results/zuban/typeddicts_operations.toml | 16 ++ .../results/zuban/typeddicts_readonly.toml | 11 + .../typeddicts_readonly_consistency.toml | 12 ++ .../typeddicts_readonly_inheritance.toml | 34 ++++ .../zuban/typeddicts_readonly_kwargs.toml | 6 + .../zuban/typeddicts_readonly_update.toml | 10 + .../results/zuban/typeddicts_required.toml | 9 + .../zuban/typeddicts_type_consistency.toml | 16 ++ .../results/zuban/typeddicts_usage.toml | 11 + conformance/results/zuban/version.toml | 2 + 139 files changed, 2704 insertions(+), 25 deletions(-) create mode 100644 conformance/results/zuban/aliases_explicit.toml create mode 100644 conformance/results/zuban/aliases_implicit.toml create mode 100644 conformance/results/zuban/aliases_newtype.toml create mode 100644 conformance/results/zuban/aliases_recursive.toml create mode 100644 conformance/results/zuban/aliases_type_statement.toml create mode 100644 conformance/results/zuban/aliases_typealiastype.toml create mode 100644 conformance/results/zuban/aliases_variance.toml create mode 100644 conformance/results/zuban/annotations_coroutines.toml create mode 100644 conformance/results/zuban/annotations_forward_refs.toml create mode 100644 conformance/results/zuban/annotations_generators.toml create mode 100644 conformance/results/zuban/annotations_methods.toml create mode 100644 conformance/results/zuban/annotations_typeexpr.toml create mode 100644 conformance/results/zuban/callables_annotation.toml create mode 100644 conformance/results/zuban/callables_kwargs.toml create mode 100644 conformance/results/zuban/callables_protocol.toml create mode 100644 conformance/results/zuban/callables_subtyping.toml create mode 100644 conformance/results/zuban/classes_classvar.toml create mode 100644 conformance/results/zuban/classes_override.toml create mode 100644 conformance/results/zuban/constructors_call_init.toml create mode 100644 conformance/results/zuban/constructors_call_metaclass.toml create mode 100644 conformance/results/zuban/constructors_call_new.toml create mode 100644 conformance/results/zuban/constructors_call_type.toml create mode 100644 conformance/results/zuban/constructors_callable.toml create mode 100644 conformance/results/zuban/constructors_consistency.toml create mode 100644 conformance/results/zuban/dataclasses_descriptors.toml create mode 100644 conformance/results/zuban/dataclasses_final.toml create mode 100644 conformance/results/zuban/dataclasses_frozen.toml create mode 100644 conformance/results/zuban/dataclasses_hash.toml create mode 100644 conformance/results/zuban/dataclasses_inheritance.toml create mode 100644 conformance/results/zuban/dataclasses_kwonly.toml create mode 100644 conformance/results/zuban/dataclasses_order.toml create mode 100644 conformance/results/zuban/dataclasses_postinit.toml create mode 100644 conformance/results/zuban/dataclasses_slots.toml create mode 100644 conformance/results/zuban/dataclasses_transform_class.toml create mode 100644 conformance/results/zuban/dataclasses_transform_converter.toml create mode 100644 conformance/results/zuban/dataclasses_transform_field.toml create mode 100644 conformance/results/zuban/dataclasses_transform_func.toml create mode 100644 conformance/results/zuban/dataclasses_transform_meta.toml create mode 100644 conformance/results/zuban/dataclasses_usage.toml create mode 100644 conformance/results/zuban/directives_assert_type.toml create mode 100644 conformance/results/zuban/directives_cast.toml create mode 100644 conformance/results/zuban/directives_deprecated.toml create mode 100644 conformance/results/zuban/directives_no_type_check.toml create mode 100644 conformance/results/zuban/directives_reveal_type.toml create mode 100644 conformance/results/zuban/directives_type_checking.toml create mode 100644 conformance/results/zuban/directives_type_ignore.toml create mode 100644 conformance/results/zuban/directives_type_ignore_file1.toml create mode 100644 conformance/results/zuban/directives_type_ignore_file2.toml create mode 100644 conformance/results/zuban/directives_version_platform.toml create mode 100644 conformance/results/zuban/enums_behaviors.toml create mode 100644 conformance/results/zuban/enums_definition.toml create mode 100644 conformance/results/zuban/enums_expansion.toml create mode 100644 conformance/results/zuban/enums_member_names.toml create mode 100644 conformance/results/zuban/enums_member_values.toml create mode 100644 conformance/results/zuban/enums_members.toml create mode 100644 conformance/results/zuban/exceptions_context_managers.toml create mode 100644 conformance/results/zuban/generics_base_class.toml create mode 100644 conformance/results/zuban/generics_basic.toml create mode 100644 conformance/results/zuban/generics_defaults.toml create mode 100644 conformance/results/zuban/generics_defaults_referential.toml create mode 100644 conformance/results/zuban/generics_defaults_specialization.toml create mode 100644 conformance/results/zuban/generics_paramspec_basic.toml create mode 100644 conformance/results/zuban/generics_paramspec_components.toml create mode 100644 conformance/results/zuban/generics_paramspec_semantics.toml create mode 100644 conformance/results/zuban/generics_paramspec_specialization.toml create mode 100644 conformance/results/zuban/generics_scoping.toml create mode 100644 conformance/results/zuban/generics_self_advanced.toml create mode 100644 conformance/results/zuban/generics_self_attributes.toml create mode 100644 conformance/results/zuban/generics_self_basic.toml create mode 100644 conformance/results/zuban/generics_self_protocols.toml create mode 100644 conformance/results/zuban/generics_self_usage.toml create mode 100644 conformance/results/zuban/generics_syntax_compatibility.toml create mode 100644 conformance/results/zuban/generics_syntax_declarations.toml create mode 100644 conformance/results/zuban/generics_syntax_infer_variance.toml create mode 100644 conformance/results/zuban/generics_syntax_scoping.toml create mode 100644 conformance/results/zuban/generics_type_erasure.toml create mode 100644 conformance/results/zuban/generics_typevartuple_args.toml create mode 100644 conformance/results/zuban/generics_typevartuple_basic.toml create mode 100644 conformance/results/zuban/generics_typevartuple_callable.toml create mode 100644 conformance/results/zuban/generics_typevartuple_concat.toml create mode 100644 conformance/results/zuban/generics_typevartuple_overloads.toml create mode 100644 conformance/results/zuban/generics_typevartuple_specialization.toml create mode 100644 conformance/results/zuban/generics_typevartuple_unpack.toml create mode 100644 conformance/results/zuban/generics_upper_bound.toml create mode 100644 conformance/results/zuban/generics_variance.toml create mode 100644 conformance/results/zuban/generics_variance_inference.toml create mode 100644 conformance/results/zuban/historical_positional.toml create mode 100644 conformance/results/zuban/literals_interactions.toml create mode 100644 conformance/results/zuban/literals_literalstring.toml create mode 100644 conformance/results/zuban/literals_parameterizations.toml create mode 100644 conformance/results/zuban/literals_semantics.toml create mode 100644 conformance/results/zuban/namedtuples_define_class.toml create mode 100644 conformance/results/zuban/namedtuples_define_functional.toml create mode 100644 conformance/results/zuban/namedtuples_type_compat.toml create mode 100644 conformance/results/zuban/namedtuples_usage.toml create mode 100644 conformance/results/zuban/narrowing_typeguard.toml create mode 100644 conformance/results/zuban/narrowing_typeis.toml create mode 100644 conformance/results/zuban/overloads_basic.toml create mode 100644 conformance/results/zuban/overloads_consistency.toml create mode 100644 conformance/results/zuban/overloads_definitions.toml create mode 100644 conformance/results/zuban/overloads_definitions_stub.toml create mode 100644 conformance/results/zuban/overloads_evaluation.toml create mode 100644 conformance/results/zuban/protocols_class_objects.toml create mode 100644 conformance/results/zuban/protocols_definition.toml create mode 100644 conformance/results/zuban/protocols_explicit.toml create mode 100644 conformance/results/zuban/protocols_generic.toml create mode 100644 conformance/results/zuban/protocols_merging.toml create mode 100644 conformance/results/zuban/protocols_modules.toml create mode 100644 conformance/results/zuban/protocols_recursive.toml create mode 100644 conformance/results/zuban/protocols_runtime_checkable.toml create mode 100644 conformance/results/zuban/protocols_self.toml create mode 100644 conformance/results/zuban/protocols_subtyping.toml create mode 100644 conformance/results/zuban/protocols_variance.toml create mode 100644 conformance/results/zuban/qualifiers_annotated.toml create mode 100644 conformance/results/zuban/qualifiers_final_annotation.toml create mode 100644 conformance/results/zuban/qualifiers_final_decorator.toml create mode 100644 conformance/results/zuban/specialtypes_any.toml create mode 100644 conformance/results/zuban/specialtypes_never.toml create mode 100644 conformance/results/zuban/specialtypes_none.toml create mode 100644 conformance/results/zuban/specialtypes_promotions.toml create mode 100644 conformance/results/zuban/specialtypes_type.toml create mode 100644 conformance/results/zuban/tuples_type_compat.toml create mode 100644 conformance/results/zuban/tuples_type_form.toml create mode 100644 conformance/results/zuban/tuples_unpacked.toml create mode 100644 conformance/results/zuban/typeddicts_alt_syntax.toml create mode 100644 conformance/results/zuban/typeddicts_class_syntax.toml create mode 100644 conformance/results/zuban/typeddicts_final.toml create mode 100644 conformance/results/zuban/typeddicts_inheritance.toml create mode 100644 conformance/results/zuban/typeddicts_operations.toml create mode 100644 conformance/results/zuban/typeddicts_readonly.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_consistency.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_inheritance.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_kwargs.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_update.toml create mode 100644 conformance/results/zuban/typeddicts_required.toml create mode 100644 conformance/results/zuban/typeddicts_type_consistency.toml create mode 100644 conformance/results/zuban/typeddicts_usage.toml create mode 100644 conformance/results/zuban/version.toml diff --git a/conformance/results/results.html b/conformance/results/results.html index aab60e772..bfa4c032d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,760 +158,900 @@

Python Type System Conformance Test Results

- + - + + + + + - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + + - + + + + + + + - + + + + - + + + + + + + + + + + - + + + + - + + + + - + + + - + + + + + - + - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + - + + + + - + + + + + + - + + - + + + + + + + + + + - +
 
mypy 1.17.0
-
1.9sec
+
mypy 1.17.1
+
7.5sec
pyright 1.1.403
-
1.4sec
+
7.3sec
pyre 0.9.25
-
7.4sec
+
14.1sec
+
zuban 0.0.18
+
1.9sec
+
Type annotations
     annotations_coroutines Pass Pass PassPass
     annotations_forward_refs
Partial

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

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

Incorrectly generates error for quoted type defined in class scope.

Pass
Partial

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

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

Does not reject f-string in quoted type annotation.

Incorrectly generates error for quoted type defined in class scope.

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

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

Partial

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

Incorrectly generates error for quoted type defined in class scope.

Does not ignore newlines in multi-line unions

     annotations_generators
Partial

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

Pass
Partial

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

Incorrectly evaluates type of call to async generator.

Pass
     annotations_methods
Pass*

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

Pass*

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

Pass*

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

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

Does not treat Never as compatible with all other types.

Pass
     specialtypes_none Pass Pass PassPass
     specialtypes_promotions Pass Pass
Partial

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

Pass
     specialtypes_type
Partial

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

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

Pass
Partial

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

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

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

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

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

Pass
+
Generics
     generics_base_class
Partial

Does not detect inconsistent type variable ordering.

Pass
Partial

Does not reject illegal use of Generic.

Does not allow using generic in assert_type expression.

Does not detect inconsistent type variable ordering.

Partial

Does not detect inconsistent type variable ordering in multi-inheritance.

     generics_basic Pass Pass
Partial

False positives in examples using constrained type variables.

False negative for constraint parameterized by a type variable.

False negative in custom map example.

False positive using `iter`.

False negative for bad type arguments to Generic/Protocol.

False negative for generic metaclass.

Pass
     generics_defaults Partial Pass
Unsupported

Does not support generic defaults.

Partial
     generics_defaults_referential Partial Pass UnsupportedPass
     generics_defaults_specialization Partial Pass
Unsupported

Does not support generic defaults.

Pass
     generics_paramspec_basic Pass Pass
Partial

Does not enforce name consistency for ParamSpec assigned to identifier.

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

Does not reject ParamSpec when used in various invalid locations.

Pass
     generics_paramspec_components Pass Pass
Partial

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

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

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

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

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

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

Pass
     generics_paramspec_semantics Pass
Pass*

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

PassPass
     generics_paramspec_specialization Pass Pass
Partial

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

Pass
     generics_scoping
Partial

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

Pass
Partial

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

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

False negative on assert_type uses.

Partial

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

     generics_self_advanced
Partial

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

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

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

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

Pass
Partial

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

False negatives on assert_type uses.

Pass*

True positive: Writing to a variable that contains Self (with a class) should error

     generics_self_attributes Pass Pass
Unsupported

Does not understand `Self` type.

Pass
     generics_self_basic Pass Pass
Partial

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

Pass
     generics_self_protocols Pass Pass
Partial

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

Pass
     generics_self_usage Pass Pass
Partial

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

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

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

Does not complain on inheritance involving `Self`.

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

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

Partial

Does not detect invalid Self when Self is not properly bound

     generics_syntax_compatibility Pass Pass
Partial

False negative on mixing legacy and PEP695 syntax.

Does not detect mixing legacy and PEP695 syntax in methods.

Pass
     generics_syntax_declarations Pass Pass
Partial

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

False negatives due to assert_type use.

Pass
     generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet support.

Pass
Partial

Incorrectly determines that a class cannot be instantiated with __getitem__.

Incorrectly handles mixing legacy and PEP695 syntax.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_scoping
Partial

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

Pass
Partial

Does not properly handle mixing legacy syntax with PEP695 syntax.

Partial

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

     generics_type_erasure
Partial

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

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

Pass
Partial

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

False negatives on instance attribute access on the type.

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

False negatives on assert_type uses.

Pass*

True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any)

     generics_typevartuple_args
Partial

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

Pass
Partial

Does not property handle TypeVarTuple.

Partial

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

     generics_typevartuple_basic
Partial

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

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

Pass
Partial

Does not support TypeVarTuple.

False negatives due to assert_type.

Partial

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

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

     generics_typevartuple_callable Pass Pass
Partial

False negatives due to assert_type.

Pass
     generics_typevartuple_concat Pass Pass
Partial

False negatives due to assert_type.

False compatability error message.

Pass
     generics_typevartuple_overloads Pass Pass
Unsupported

Does not support star expressions for `Unpack`.

Pass
     generics_typevartuple_specialization
Partial

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

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

Pass
Unsupported

Does not support star expressions for `Unpack`.

Pass
     generics_typevartuple_unpack Pass Pass PassPass
     generics_upper_bound
Partial

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

Pass
Partial

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

Does not complain when bound is used alongside type constraints.

Partial

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

     generics_variance
Partial

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

Pass
Partial

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

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

Partial

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

     generics_variance_inference Pass Pass
Partial

Does not properly handle mixing legacy and PEP695 syntax.

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

Pass
+
Type qualifiers
     qualifiers_annotated
Partial

Does not allow ClassVar to be nested within Annotated.

Does not allow Final to be nested within Annotated.

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

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

Does not reject call of type alias defined with Annotated.

Pass
Partial

Does not reject Annotated with a single parameter.

Does not reject call of Annotated with no type arguments.

Pass
     qualifiers_final_annotation
Partial

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

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

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

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

Pass
Partial

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

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

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

Does not reject modification of imported variable declared Final.

Partial

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

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

     qualifiers_final_decorator Pass Pass
Partial

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

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

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

Pass
+
Class type compatibility
     classes_classvar
Partial

Internal error if TypeVarTuple is used in ClassVar.

Does not reject use of ParamSpec in ClassVar.

Rejects ClassVar nested in Annotated.

Does not reject use of ClassVar in TypeAlias definition.

Pass
Partial

Does not reject use of TypeVar in ClassVar.

Does not reject use of ParamSpec in ClassVar.

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

Does not reject use of ClassVar in parameter type annotation.

Does not reject use of ClassVar in local variable annotation.

Does not reject use of ClassVar in instance variable annotation.

Does not reject use of ClassVar in return type annotation.

Does not reject use of ClassVar in type alias definition.

Does not infer type from initialization for bare ClassVar.

Pass
     classes_override Pass Pass PassPass
+
Type aliases
     aliases_explicit
Partial

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

Pass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

Does not report some illegal annotation forms as invalid type aliases.

Does not report invalid specialization of generic type aliases.

Incorrectly rejects import alias of `TypeAlias` when used to define type alias.

Does not report invalid specialization of already-specialized generic type alias.

Pass
     aliases_implicit Pass Pass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

Does not report invalid specialization of generic type aliases.

Does not report error for attempt to instantiate union type alias.

Does not report invalid specialization of already-specialized generic type alias.

Pass
     aliases_newtype
Partial

`NewType`s are considered classes, not functions.

Pass
Partial

Does not reject use of NewType in `isinstance` call.

Does not reject use of NewType in class definition statement.

Does not report inconsistency between name of NewType and assigned identifier name.

Does not reject use of NewType with generic class with TypeVar.

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

Pass
     aliases_recursive Pass Pass
Partial

Does not properly handle some recursive type aliases.

Does not properly handle specialization of generic recursive type aliases.

Pass
     aliases_type_statement
Partial

Does not reject type alias defined in function scope.

Pass
Partial

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

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

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

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

Does not properly support recursive aliases.

Pass
     aliases_typealiastype
Partial

Incorrectly rejects some recursive type aliases using TypeAliasType.

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

Pass
Unsupported

Support for TypeAliasType is not implemented.

Partial

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

Incorrectly allows type_params= to be an arbitrary tuple.

     aliases_variance Pass Pass PassPass
+
Literals
     literals_interactions
Partial

Does not narrow type of `x` with `x in Literal` type guard pattern.

Pass
Partial

Does not detect out-of-bound tuple literal index.

Does not perform exhaustiveness checks on enums.

Does not narrow type of `x` with `x in Literal` type guard pattern.

Does not narrow type of `x` with `x == Literal` type guard pattern.

Partial

Does not narrow type of `x` with `x in Literal` type guard pattern.

     literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

Pass
Partial

Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

Unsupported

Support for `LiteralString` is not implemented.

     literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass
Partial

Does not support type aliases in Literal type expression.

Does not support nested Literal type expression.

Does not reject tuple in Literal type expression.

Does not reject "bare" Literal in type expression.

Pass
     literals_semantics Pass Pass PassPass
+
Protocols
     protocols_class_objects Pass Pass
Partial

Does not reject protocol class assigned to type[Proto].

Incorrectly reports some class objects as incompatible with a protocol.

Fails to report some class objects as incompatible with a protocol.

Pass
     protocols_definition
Partial

Does not detect protocol mismatch if concrete method is missing annotations.

Does not detect protocol mismatch if concrete method's parameters are position-only.

Pass
Partial

Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa.

Does not reject read-only property in concrete class when attribute in protocol is mutable.

Does not reject covariant attribute type when protocol attribute is mutable.

Does not reject read-only property in concrete class when protocol has settable property.

Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

Partial

Does not detect protocol mismatch if concrete method is missing annotations.

Does not detect protocol mismatch if concrete method's parameters are position-only.

     protocols_explicit
Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

Pass
Partial

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

Does not report error when method is not implemented in derived class.

Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

     protocols_generic Pass Pass
Partial

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

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

Pass
     protocols_merging Pass Pass PassPass
     protocols_modules Pass Pass
Unsupported

Does not perform protocol checks for modules.

Pass
     protocols_recursive Pass Pass PassPass
     protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass
Unsupported

Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

Does not reject issubclass call for data protocol.

Does not report unsafe overlap for runtime_checkable protocol.

Partial

Does not report unsafe overlap for runtime_checkable protocol.

     protocols_self Pass Pass PassPass
     protocols_subtyping Pass Pass PassPass
     protocols_variance Pass Pass
Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

Pass
+
Callables
     callables_annotation
Partial

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

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

Pass
Partial

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

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

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

Partial

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

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

     callables_kwargs
Partial

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

Pass PassPass
     callables_protocol Pass Pass
Partial

Does not correctly handle callback protocol that declares attributes in all functions.

Does not report type incompatibility for callback protocol with positional-only parameters.

Incorrectly reports type compatibility error with callback that has *args and **kwargs.

Does not report type incompatibility for callback missing a default argument for positional parameter.

Does not report type incompatibility for callback missing a default argument for keyword parameter.

Pass
     callables_subtyping Pass Pass
Partial

Rejects standard parameter as incompatible with keyword-only parameter.

Rejects use of Callable with ParamSpec in TypeAlias definition.

Pass
+
Constructors
     constructors_call_init
Partial

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

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

Pass
Partial

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

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

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

Incorrectly raises Incompatible overload type errors.

Incorrectly raises compatibility type errors.

Partial

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

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

     constructors_call_metaclass
Unupported

Does not honor metaclass __call__ method when evaluating constructor call.

Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

Pass
Partial

Does not evaluate __new__ if metaclass __call__ is defined.

Unupported

Does not honor metaclass __call__ method when evaluating constructor call.

Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

     constructors_call_new
Partial

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

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

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

Pass
Partial

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

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

Incorrectly raises compatibility type errors.

Partial

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

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

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

     constructors_call_type
Partial

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

Pass Pass
Partial

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

     constructors_callable
Partial

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

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

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

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

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

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

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

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

Incorrectly raises incompatibility type errors.

Partial

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

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

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

     constructors_consistency
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

Pass
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

Pass
+
Overloads
     overloads_basic Pass Pass PassPass
     overloads_consistency Pass Pass
Partial

Does not apply decorator transforms before checking overload consistency.

Pass
     overloads_definitions
Partial

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

Pass
Partial

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

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

Pass
     overloads_definitions_stub
Partial

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

Pass
Partial

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

Pass
     overloads_evaluation
Partial

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

Does not expand enum arguments to literal variants.

Does not expand tuple arguments to possible combinations.

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

Evaluates Any in some cases where overload is not ambiguous.

Partial

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

Partial

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

Does not expand enum arguments to literal variants.

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

Does not expand tuple arguments to possible combinations.

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

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

Partial

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

Does not expand enum arguments to literal variants.

Does not expand tuple arguments to possible combinations.

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

Evaluates Any in some cases where overload is not ambiguous.

+
Exceptions
     exceptions_context_managers Pass Pass
Partial

assert_type causes failures.

Pass
+
Dataclasses
     dataclasses_descriptors
Partial

Does not correctly evaluate type of descriptor access.

Pass
Partial

Incorrectly generates error when calling constructor of dataclass with descriptor.

Incorrectly raises incompatibility type errors.

Pass
     dataclasses_final
Partial

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

Doesn't support Final nested inside ClassVar.

Pass Pass
Partial

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

Doesn't support Final nested inside ClassVar.

     dataclasses_frozen Pass Pass PassPass
     dataclasses_hash
Partial

Does not report when dataclass is not compatible with Hashable protocol.

Pass
Partial

Does not report when dataclass is not compatible with Hashable protocol.

Partial

Does not report when dataclass is not compatible with Hashable protocol.

     dataclasses_inheritance Pass Pass
Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

Pass
     dataclasses_kwonly Pass Pass
Partial

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

Pass
     dataclasses_order Pass Pass PassPass
     dataclasses_postinit Pass Pass
Partial

Does not perform validation of `__post_init__` method.

Incorrectly complains on the assignment of `InitVar` in class bodies.

Pass
     dataclasses_slots
Partial

Does not reject write to instance variable that is not defined in __slots__.

Pass
Partial

Does not report error when `slots=True` is used with `__slots__` definition.

Does not reject write to instance variable that is not defined in __slots__.

Does not reject access to `__slots__` from dataclass instance when `slots=False`.

Partial

Does not reject write to instance variable that is not defined in __slots__.

     dataclasses_transform_class Pass Pass
Partial

Does not support field specifiers.

Emits "attribute not initialized" error for dataclass field.

Pass
     dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

Pass
Unsupported

Converter parameter not yet supported.

Unsupported

Converter parameter not yet supported.

     dataclasses_transform_field
Partial

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

Pass
Unsupported

Does not understand dataclass transform field specifiers.

Pass
     dataclasses_transform_func
Partial

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

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

Pass
Partial

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

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

Emits "attribute not initialized" error for dataclass field.

Pass
     dataclasses_transform_meta Pass Pass
Partial

Does not understand custom field specifiers.

Incorrectly rejects frozen dataclass that inherits from non-frozen.

Emits "attribute not initialized" error for dataclass field.

Pass
     dataclasses_usage
Pass*

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

Pass
Partial

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

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

Does not understand `__dataclass_fields__`.

Incorrectly raises incompatibility type errors.

Pass
+
Typed dictionaries
     typeddicts_alt_syntax
Pass*

Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

Pass
Partial

Does not report when name of TypedDict doesn't match assigned identifier name.

Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

Pass*

Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

     typeddicts_class_syntax Pass Pass
Partial

Does not reject methods within TypedDict class.

Does not report when metaclass is provided.

Does not report when other keyword argument is provided.

Does not support generic TypedDict class.

Pass
     typeddicts_final Pass Pass
Partial

Does not handle value with literal type as index to TypedDict object.

Pass
     typeddicts_inheritance Pass Pass PassPass
     typeddicts_operations Pass Pass PassPass
     typeddicts_readonly Pass Pass PassPass
     typeddicts_readonly_consistency Pass Pass PassPass
     typeddicts_readonly_inheritance
Partial

Incorrectly rejects non-ReadOnly override of ReadOnly item.

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

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

Pass Unsupported
Partial

Incorrectly rejects non-ReadOnly override of ReadOnly item.

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

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

     typeddicts_readonly_kwargs Pass Pass PassPass
     typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

Pass Pass
Partial

Incorrectly allows update of ReadOnly item.

     typeddicts_required Pass Pass
Partial

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

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

Does not support recursive TypedDict definitions.

Incorrectly complains about uninitialized attributes on TypedDict definitions.

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

Pass
     typeddicts_type_consistency Pass Pass
Partial

Does not reject assignment of TypedDict with missing key.

Does not return non-Optional value from `get` method for required key.

Does not properly handle nested TypedDicts.

Pass
     typeddicts_usage Pass Pass
Pass*

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

Does not reject use of TypedDict as TypeVar bound.

Pass
+
Tuples
     tuples_type_compat
Partial

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

Pass
Partial

Does not support some unpacked tuple forms.

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

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

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

Pass*

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

     tuples_type_form Pass Pass PassPass
     tuples_unpacked
Partial

"More than one unpack" error is missing in some cases.

Pass PassPass
+
Named tuples
     namedtuples_define_class
Partial

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

Pass
Partial

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

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

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

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

Incorrectly rejects assignment of named tuple to a tuple with compatible type.

Does not reject attempt to use NamedTuple with multiple inheritance.

Partial

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

     namedtuples_define_functional Pass Pass PassPass
     namedtuples_type_compat Pass Pass PassPass
     namedtuples_usage
Partial

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

Pass PartialPass
+
Enumerations
     enums_behaviors Pass Pass PassPass
     enums_definition Pass Pass PassPass
     enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Pass Pass
Partial

Improperly applies narrowing to Flag subclass.

     enums_member_names
Pass*

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

Pass
Pass*

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

Pass
     enums_member_values
Partial

Does not enforce declared type of `_value_`.

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

Pass Pass
Partial

Does not enforce declared type of `_value_`.

     enums_members
Partial

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

Does not treat callables as non-members.

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

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

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

Pass*

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not treat annotated attributes as non-members.

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

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

Does not properly handle aliased enum members.

Rejects use of `_ignore_`.

Does not support `_ignore_` mechanism (optional).

Partial

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

Does not properly handle aliased enum members.

Does not treat somecallables as non-members.

+
Type narrowing
     narrowing_typeguard Pass Pass PassPass
     narrowing_typeis Pass Pass PassPass
+
Type checker directives
     directives_assert_type Pass Pass PassPass
     directives_cast Pass Pass PassPass
     directives_deprecated Pass Pass
Unsupported

Does not support @deprecated.

Unsupported
     directives_no_type_check
Partial

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

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

Pass*

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

Pass*

Does not honor @no_type_check decorator.

Pass
     directives_reveal_type Pass Pass PassPass
     directives_type_checking Pass Pass PassPass
     directives_type_ignore
Partial

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

Pass Pass
Partial

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

     directives_type_ignore_file1 Pass Pass PassPass
     directives_type_ignore_file2 Pass Pass PassPass
     directives_version_platform
Pass*

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

Does not understand os.name checks.

Pass PassPass
+
Historical and deprecated features
     historical_positional
Partial

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

Treats keyword-only parameter as positional-only.

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

Pass Pass
Partial

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

Treats keyword-only parameter as positional-only.

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

diff --git a/conformance/results/zuban/aliases_explicit.toml b/conformance/results/zuban/aliases_explicit.toml new file mode 100644 index 000000000..3f056707b --- /dev/null +++ b/conformance/results/zuban/aliases_explicit.toml @@ -0,0 +1,29 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_explicit.py:67: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type +aliases_explicit.py:80: note: Did you mean "List[...]"? +aliases_explicit.py:81: error: Syntax error in type annotation +aliases_explicit.py:81: note: Suggestion: Is there a spurious trailing comma? +aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:87: error: Variable "aliases_explicit.var1" is not valid as a type +aliases_explicit.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_explicit.py:88: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? +aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:100: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:101: error: "" not callable +aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 +""" diff --git a/conformance/results/zuban/aliases_implicit.toml b/conformance/results/zuban/aliases_implicit.toml new file mode 100644 index 000000000..000b3d757 --- /dev/null +++ b/conformance/results/zuban/aliases_implicit.toml @@ -0,0 +1,41 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_implicit.py:76: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" +aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type +aliases_implicit.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:107: error: Variable "aliases_implicit.BadTypeAlias2" is not valid as a type +aliases_implicit.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:108: error: Variable "aliases_implicit.BadTypeAlias3" is not valid as a type +aliases_implicit.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:109: error: Variable "aliases_implicit.BadTypeAlias4" is not valid as a type +aliases_implicit.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:110: error: Variable "aliases_implicit.BadTypeAlias5" is not valid as a type +aliases_implicit.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:111: error: Variable "aliases_implicit.BadTypeAlias6" is not valid as a type +aliases_implicit.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:112: error: Variable "aliases_implicit.BadTypeAlias7" is not valid as a type +aliases_implicit.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:113: error: Variable "aliases_implicit.BadTypeAlias8" is not valid as a type +aliases_implicit.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:114: error: Variable "aliases_implicit.var1" is not valid as a type +aliases_implicit.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:115: error: Variable "aliases_implicit.BadTypeAlias10" is not valid as a type +aliases_implicit.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:116: error: Variable "aliases_implicit.BadTypeAlias11" is not valid as a type +aliases_implicit.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:117: error: Variable "aliases_implicit.BadTypeAlias12" is not valid as a type +aliases_implicit.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is not valid as a type +aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type +aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:133: error: "UnionType" not callable +aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 +""" diff --git a/conformance/results/zuban/aliases_newtype.toml b/conformance/results/zuban/aliases_newtype.toml new file mode 100644 index 000000000..2500008d3 --- /dev/null +++ b/conformance/results/zuban/aliases_newtype.toml @@ -0,0 +1,21 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" +aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") +aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") +aliases_newtype.py:23: error: Cannot use isinstance() with NewType type +aliases_newtype.py:26: error: Cannot subclass "NewType" +aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" +aliases_newtype.py:41: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_newtype.py:47: error: Argument 2 to NewType(...) must be subclassable (got "int | str") +aliases_newtype.py:50: error: Type variable "aliases_newtype.T" is unbound +aliases_newtype.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_newtype.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_newtype.py:52: error: NewType cannot be used with protocol classes +aliases_newtype.py:54: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") +aliases_newtype.py:61: error: Argument 2 to NewType(...) must be subclassable (got "TD1") +aliases_newtype.py:63: error: NewType(...) expects exactly two positional arguments +aliases_newtype.py:65: error: Argument 2 to NewType(...) must be subclassable (got "Any") +""" diff --git a/conformance/results/zuban/aliases_recursive.toml b/conformance/results/zuban/aliases_recursive.toml new file mode 100644 index 000000000..daf88ae2f --- /dev/null +++ b/conformance/results/zuban/aliases_recursive.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "None | int | str | float | list[Json] | dict[str, Json]" +aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "None | int | str | float | list[Json] | dict[str, Json]" +aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "str | int | tuple[RecursiveTuple, ...]") +aliases_recursive.py:39: error: Name "t6" already defined on line 38 +aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "str | int | tuple[RecursiveTuple, ...]") +aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" +aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" +aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself +aliases_recursive.py:75: error: Invalid recursive alias: a union item of itself +""" diff --git a/conformance/results/zuban/aliases_type_statement.toml b/conformance/results/zuban/aliases_type_statement.toml new file mode 100644 index 000000000..02494e07c --- /dev/null +++ b/conformance/results/zuban/aliases_type_statement.toml @@ -0,0 +1,35 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" +aliases_type_statement.py:19: error: "TypeAliasType" not callable +aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" +aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" +aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type +aliases_type_statement.py:38: note: Did you mean "List[...]"? +aliases_type_statement.py:39: error: Syntax error in type annotation +aliases_type_statement.py:39: note: Suggestion: Is there a spurious trailing comma? +aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type +aliases_type_statement.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:46: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? +aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 +aliases_type_statement.py:56: error: Type alias not allowed in function +aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) +aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) +aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" +aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" +aliases_type_statement.py:82: error: Invalid recursive alias: a union item of itself +aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself +aliases_type_statement.py:88: error: Invalid recursive alias: a union item of itself +""" diff --git a/conformance/results/zuban/aliases_typealiastype.toml b/conformance/results/zuban/aliases_typealiastype.toml new file mode 100644 index 000000000..99edcc60d --- /dev/null +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -0,0 +1,38 @@ +conformant = "Partial" +notes = """ +Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. +Incorrectly allows type_params= to be an arbitrary tuple. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 45: Expected 1 errors +Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Can\\'t use bound type variable "T" to define generic alias'] +""" +output = """ +aliases_typealiastype.py:27: error: Can't use bound type variable "T" to define generic alias +aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" +aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" +aliases_typealiastype.py:43: error: All type parameters should be declared ("S" not declared) +aliases_typealiastype.py:44: error: All type parameters should be declared ("S" not declared) +aliases_typealiastype.py:46: error: Invalid recursive alias: a union item of itself +aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself +aliases_typealiastype.py:48: error: Variable "aliases_typealiastype.BadAlias7" is not valid as a type +aliases_typealiastype.py:48: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type +aliases_typealiastype.py:53: note: Did you mean "List[...]"? +aliases_typealiastype.py:54: error: Syntax error in type annotation +aliases_typealiastype.py:54: note: Suggestion: Is there a spurious trailing comma? +aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:60: error: Variable "aliases_typealiastype.var1" is not valid as a type +aliases_typealiastype.py:60: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:61: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? +aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:66: error: Name "BadAlias21" is used before definition +""" diff --git a/conformance/results/zuban/aliases_variance.toml b/conformance/results/zuban/aliases_variance.toml new file mode 100644 index 000000000..461ba7dcc --- /dev/null +++ b/conformance/results/zuban/aliases_variance.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_variance.py:24: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:28: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:32: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:44: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +""" diff --git a/conformance/results/zuban/annotations_coroutines.toml b/conformance/results/zuban/annotations_coroutines.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/annotations_coroutines.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml new file mode 100644 index 000000000..8fcc15164 --- /dev/null +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -0,0 +1,52 @@ +conformant = "Partial" +notes = """ +Does not report error for a forward reference that is not enclosed in quotes. +Incorrectly generates error for quoted type defined in class scope. +Does not ignore newlines in multi-line unions +""" +conformance_automated = "Fail" +errors_diff = """ +Line 22: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 66: Expected 1 errors +Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined'] +Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type'] +Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str"'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int"'] +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax'] +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax', 'annotations_forward_refs.py:105: error: invalid syntax'] +""" +output = """ +annotations_forward_refs.py:41: error: Invalid type comment or annotation +annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type +annotations_forward_refs.py:42: note: Did you mean "List[...]"? +annotations_forward_refs.py:43: error: Syntax error in type annotation +annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_forward_refs.py:44: error: Invalid type comment or annotation +annotations_forward_refs.py:45: error: Invalid type comment or annotation +annotations_forward_refs.py:46: error: Invalid type comment or annotation +annotations_forward_refs.py:47: error: Invalid type comment or annotation +annotations_forward_refs.py:48: error: Invalid type comment or annotation +annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type +annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_forward_refs.py:50: error: Invalid type comment or annotation +annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? +annotations_forward_refs.py:52: error: Invalid type comment or annotation +annotations_forward_refs.py:53: error: Invalid type comment or annotation +annotations_forward_refs.py:54: error: Invalid type comment or annotation +annotations_forward_refs.py:55: error: Module "types" is not valid as a type +annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? +annotations_forward_refs.py:80: error: Name "ClassF" is not defined +annotations_forward_refs.py:82: error: Name "str" is not defined +annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" +annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" +annotations_forward_refs.py:104: error: invalid syntax +annotations_forward_refs.py:105: error: invalid syntax +annotations_forward_refs.py:105: error: invalid syntax +""" diff --git a/conformance/results/zuban/annotations_generators.toml b/conformance/results/zuban/annotations_generators.toml new file mode 100644 index 000000000..fa4ba7567 --- /dev/null +++ b/conformance/results/zuban/annotations_generators.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_generators.py:51: error: Missing return statement +annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") +annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") +annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") +annotations_generators.py:71: error: No return value expected +annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") +annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes +annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes +annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") +annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") +annotations_generators.py:135: error: Incompatible send types in yield from (actual type "int", expected type "str") +""" diff --git a/conformance/results/zuban/annotations_methods.toml b/conformance/results/zuban/annotations_methods.toml new file mode 100644 index 000000000..bd95236e4 --- /dev/null +++ b/conformance/results/zuban/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_methods.py:42: error: Expression is of type "B", not "A" +""" diff --git a/conformance/results/zuban/annotations_typeexpr.toml b/conformance/results/zuban/annotations_typeexpr.toml new file mode 100644 index 000000000..3ac4eea14 --- /dev/null +++ b/conformance/results/zuban/annotations_typeexpr.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_typeexpr.py:88: error: Invalid type comment or annotation +annotations_typeexpr.py:89: error: Bracketed expression "[...]" is not valid as a type +annotations_typeexpr.py:89: note: Did you mean "List[...]"? +annotations_typeexpr.py:90: error: Syntax error in type annotation +annotations_typeexpr.py:90: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_typeexpr.py:91: error: Invalid type comment or annotation +annotations_typeexpr.py:92: error: Invalid type comment or annotation +annotations_typeexpr.py:93: error: Invalid type comment or annotation +annotations_typeexpr.py:94: error: Invalid type comment or annotation +annotations_typeexpr.py:95: error: Invalid type comment or annotation +annotations_typeexpr.py:96: error: Variable "annotations_typeexpr.var1" is not valid as a type +annotations_typeexpr.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_typeexpr.py:97: error: Invalid type comment or annotation +annotations_typeexpr.py:98: error: Invalid type: try using Literal[1] instead? +annotations_typeexpr.py:99: error: Invalid type comment or annotation +annotations_typeexpr.py:100: error: Invalid type comment or annotation +annotations_typeexpr.py:101: error: Invalid type comment or annotation +annotations_typeexpr.py:102: error: Module "types" is not valid as a type +annotations_typeexpr.py:102: note: Perhaps you meant to use a protocol matching the module structure? +""" diff --git a/conformance/results/zuban/callables_annotation.toml b/conformance/results/zuban/callables_annotation.toml new file mode 100644 index 000000000..5f7ccb0f9 --- /dev/null +++ b/conformance/results/zuban/callables_annotation.toml @@ -0,0 +1,36 @@ +conformant = "Partial" +notes = """ +Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any. +Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 159: Expected 1 errors +Line 157: Unexpected errors ['callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6")'] +""" +output = """ +callables_annotation.py:25: error: Too few arguments +callables_annotation.py:26: error: Argument 2 has incompatible type "int"; expected "str" +callables_annotation.py:27: error: Too many arguments +callables_annotation.py:29: error: Unexpected keyword argument "a" +callables_annotation.py:29: error: Unexpected keyword argument "b" +callables_annotation.py:35: error: Too many arguments +callables_annotation.py:55: error: Please use "Callable[[], ]" or "Callable" +callables_annotation.py:56: error: The first argument to Callable must be a list of types, parameter specification, or "..." +callables_annotation.py:56: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas +callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as a type +callables_annotation.py:57: note: Did you mean "List[...]"? +callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" +callables_annotation.py:59: error: Unexpected "..." +callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") +callables_annotation.py:157: note: Following member(s) of "Proto7" have conflicts: +callables_annotation.py:157: note: Expected: +callables_annotation.py:157: note: def __call__(self, int, /, *args: Any, k: str, **kwargs: Any) -> None +callables_annotation.py:157: note: Got: +callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None +callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") +""" diff --git a/conformance/results/zuban/callables_kwargs.toml b/conformance/results/zuban/callables_kwargs.toml new file mode 100644 index 000000000..4e3308105 --- /dev/null +++ b/conformance/results/zuban/callables_kwargs.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_kwargs.py:46: error: Missing named argument "v1" for "func1" +callables_kwargs.py:46: error: Missing named argument "v3" for "func1" +callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" +callables_kwargs.py:52: error: Too many positional arguments for "func1" +callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "int" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" +callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument "v1" +callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" +callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" +callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" +callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol3") +callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol4") +callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol5") +callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" +callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict +callables_kwargs.py:134: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'v1'), NamedArg(str, 'v3'), DefaultNamedArg(str, 'v2')], None]", variable has type "TDProtocol6") +""" diff --git a/conformance/results/zuban/callables_protocol.toml b/conformance/results/zuban/callables_protocol.toml new file mode 100644 index 000000000..dad94dc56 --- /dev/null +++ b/conformance/results/zuban/callables_protocol.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], None]", variable has type "Proto2") +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], None]", variable has type "Proto2") +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], None]", variable has type "Proto2") +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], None]", variable has type "Proto2") +callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") +callables_protocol.py:97: note: "Callable[[int], None]" is missing following "Proto4" protocol member: +callables_protocol.py:97: note: other_attribute +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") +callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") +callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") +callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" +callables_protocol.py:197: error: "Proto9[[x: int], str]" has no attribute "other_attribute2" +callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") +callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") +""" diff --git a/conformance/results/zuban/callables_subtyping.toml b/conformance/results/zuban/callables_subtyping.toml new file mode 100644 index 000000000..ff4f95664 --- /dev/null +++ b/conformance/results/zuban/callables_subtyping.toml @@ -0,0 +1,187 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_subtyping.py:26: error: Incompatible types in assignment (expression has type "Callable[[int], int]", variable has type "Callable[[float], float]") +callables_subtyping.py:29: error: Incompatible types in assignment (expression has type "Callable[[float], float]", variable has type "Callable[[int], int]") +callables_subtyping.py:51: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "Standard2") +callables_subtyping.py:51: note: Following member(s) of "PosOnly2" have conflicts: +callables_subtyping.py:51: note: Expected: +callables_subtyping.py:51: note: def __call__(self, a: int, b: int) -> None +callables_subtyping.py:51: note: Got: +callables_subtyping.py:51: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:52: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "Standard2") +callables_subtyping.py:52: note: Following member(s) of "KwOnly2" have conflicts: +callables_subtyping.py:52: note: Expected: +callables_subtyping.py:52: note: def __call__(self, a: int, b: int) -> None +callables_subtyping.py:52: note: Got: +callables_subtyping.py:52: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:55: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "PosOnly2") +callables_subtyping.py:55: note: Following member(s) of "KwOnly2" have conflicts: +callables_subtyping.py:55: note: Expected: +callables_subtyping.py:55: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:55: note: Got: +callables_subtyping.py:55: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:58: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "KwOnly2") +callables_subtyping.py:58: note: Following member(s) of "PosOnly2" have conflicts: +callables_subtyping.py:58: note: Expected: +callables_subtyping.py:58: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:58: note: Got: +callables_subtyping.py:58: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:82: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "IntArgs3") +callables_subtyping.py:82: note: Following member(s) of "NoArgs3" have conflicts: +callables_subtyping.py:82: note: Expected: +callables_subtyping.py:82: note: def __call__(self, *args: int) -> None +callables_subtyping.py:82: note: Got: +callables_subtyping.py:82: note: def __call__(self) -> None +callables_subtyping.py:85: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "FloatArgs3") +callables_subtyping.py:85: note: Following member(s) of "NoArgs3" have conflicts: +callables_subtyping.py:85: note: Expected: +callables_subtyping.py:85: note: def __call__(self, *args: float) -> None +callables_subtyping.py:85: note: Got: +callables_subtyping.py:85: note: def __call__(self) -> None +callables_subtyping.py:86: error: Incompatible types in assignment (expression has type "IntArgs3", variable has type "FloatArgs3") +callables_subtyping.py:86: note: Following member(s) of "IntArgs3" have conflicts: +callables_subtyping.py:86: note: Expected: +callables_subtyping.py:86: note: def __call__(self, *args: float) -> None +callables_subtyping.py:86: note: Got: +callables_subtyping.py:86: note: def __call__(self, *args: int) -> None +callables_subtyping.py:116: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "PosOnly4") +callables_subtyping.py:116: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:116: note: Expected: +callables_subtyping.py:116: note: def __call__(self, int, str, /) -> None +callables_subtyping.py:116: note: Got: +callables_subtyping.py:116: note: def __call__(self, *args: int) -> None +callables_subtyping.py:119: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:119: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:119: note: Expected: +callables_subtyping.py:119: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:119: note: Got: +callables_subtyping.py:119: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:120: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:120: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:120: note: Expected: +callables_subtyping.py:120: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:120: note: Got: +callables_subtyping.py:120: note: def __call__(self, *args: int) -> None +callables_subtyping.py:122: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "StrArgs4") +callables_subtyping.py:122: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:122: note: Expected: +callables_subtyping.py:122: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:122: note: Got: +callables_subtyping.py:122: note: def __call__(self, *args: int) -> None +callables_subtyping.py:124: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntArgs4") +callables_subtyping.py:124: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:124: note: Expected: +callables_subtyping.py:124: note: def __call__(self, *args: int) -> None +callables_subtyping.py:124: note: Got: +callables_subtyping.py:124: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:125: error: Incompatible types in assignment (expression has type "IntStrArgs4", variable has type "Standard4") +callables_subtyping.py:125: note: Following member(s) of "IntStrArgs4" have conflicts: +callables_subtyping.py:125: note: Expected: +callables_subtyping.py:125: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:125: note: Got: +callables_subtyping.py:125: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:126: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "Standard4") +callables_subtyping.py:126: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:126: note: Expected: +callables_subtyping.py:126: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:126: note: Got: +callables_subtyping.py:126: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:151: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "IntKwargs5") +callables_subtyping.py:151: note: Following member(s) of "NoKwargs5" have conflicts: +callables_subtyping.py:151: note: Expected: +callables_subtyping.py:151: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:151: note: Got: +callables_subtyping.py:151: note: def __call__(self) -> None +callables_subtyping.py:154: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:154: note: Following member(s) of "NoKwargs5" have conflicts: +callables_subtyping.py:154: note: Expected: +callables_subtyping.py:154: note: def __call__(self, **kwargs: float) -> None +callables_subtyping.py:154: note: Got: +callables_subtyping.py:154: note: def __call__(self) -> None +callables_subtyping.py:155: error: Incompatible types in assignment (expression has type "IntKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:155: note: Following member(s) of "IntKwargs5" have conflicts: +callables_subtyping.py:155: note: Expected: +callables_subtyping.py:155: note: def __call__(self, **kwargs: float) -> None +callables_subtyping.py:155: note: Got: +callables_subtyping.py:155: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:187: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "KwOnly6") +callables_subtyping.py:187: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:187: note: Expected: +callables_subtyping.py:187: note: def __call__(self, *, a: int, b: str) -> None +callables_subtyping.py:187: note: Got: +callables_subtyping.py:187: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:190: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:190: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:190: note: Expected: +callables_subtyping.py:190: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:190: note: Got: +callables_subtyping.py:190: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:191: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:191: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:191: note: Expected: +callables_subtyping.py:191: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:191: note: Got: +callables_subtyping.py:191: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:193: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "StrKwargs6") +callables_subtyping.py:193: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:193: note: Expected: +callables_subtyping.py:193: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:193: note: Got: +callables_subtyping.py:193: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:195: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntKwargs6") +callables_subtyping.py:195: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:195: note: Expected: +callables_subtyping.py:195: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:195: note: Got: +callables_subtyping.py:195: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:196: error: Incompatible types in assignment (expression has type "IntStrKwargs6", variable has type "Standard6") +callables_subtyping.py:196: note: Following member(s) of "IntStrKwargs6" have conflicts: +callables_subtyping.py:196: note: Expected: +callables_subtyping.py:196: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:196: note: Got: +callables_subtyping.py:196: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:197: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "Standard6") +callables_subtyping.py:197: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:197: note: Expected: +callables_subtyping.py:197: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:197: note: Got: +callables_subtyping.py:197: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:236: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "DefaultArg8") +callables_subtyping.py:236: note: Following member(s) of "NoDefaultArg8" have conflicts: +callables_subtyping.py:236: note: Expected: +callables_subtyping.py:236: note: def __call__(self, x: int = ...) -> None +callables_subtyping.py:236: note: Got: +callables_subtyping.py:236: note: def __call__(self, x: int) -> None +callables_subtyping.py:237: error: Incompatible types in assignment (expression has type "NoX8", variable has type "DefaultArg8") +callables_subtyping.py:237: note: Following member(s) of "NoX8" have conflicts: +callables_subtyping.py:237: note: Expected: +callables_subtyping.py:237: note: def __call__(self, x: int = ...) -> None +callables_subtyping.py:237: note: Got: +callables_subtyping.py:237: note: def __call__(self) -> None +callables_subtyping.py:240: error: Incompatible types in assignment (expression has type "NoX8", variable has type "NoDefaultArg8") +callables_subtyping.py:240: note: Following member(s) of "NoX8" have conflicts: +callables_subtyping.py:240: note: Expected: +callables_subtyping.py:240: note: def __call__(self, x: int) -> None +callables_subtyping.py:240: note: Got: +callables_subtyping.py:240: note: def __call__(self) -> None +callables_subtyping.py:243: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "NoX8") +callables_subtyping.py:243: note: Following member(s) of "NoDefaultArg8" have conflicts: +callables_subtyping.py:243: note: Expected: +callables_subtyping.py:243: note: def __call__(self) -> None +callables_subtyping.py:243: note: Got: +callables_subtyping.py:243: note: def __call__(self, x: int) -> None +callables_subtyping.py:273: error: Incompatible types in assignment (expression has type "Overloaded9", variable has type "FloatArg9") +callables_subtyping.py:273: note: Following member(s) of "Overloaded9" have conflicts: +callables_subtyping.py:273: note: Expected: +callables_subtyping.py:273: note: def __call__(self: FloatArg9, x: float) -> float +callables_subtyping.py:273: note: Got: +callables_subtyping.py:273: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:297: error: Incompatible types in assignment (expression has type "StrArg10", variable has type "Overloaded10") +callables_subtyping.py:297: note: Following member(s) of "StrArg10" have conflicts: +callables_subtyping.py:297: note: Expected: +callables_subtyping.py:297: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:297: note: Got: +callables_subtyping.py:297: note: def __call__(self: StrArg10, x: str) -> complex +""" diff --git a/conformance/results/zuban/classes_classvar.toml b/conformance/results/zuban/classes_classvar.toml new file mode 100644 index 000000000..88e7b0a93 --- /dev/null +++ b/conformance/results/zuban/classes_classvar.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_classvar.py:38: error: ClassVar[...] must have at most one type argument +classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? +classes_classvar.py:40: error: Name "var" is not defined +classes_classvar.py:45: error: ClassVar cannot contain type variables +classes_classvar.py:46: error: ClassVar cannot contain type variables +classes_classvar.py:47: error: ClassVar cannot contain type variables +classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") +classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final +classes_classvar.py:55: error: Invalid Type: ClassVar nested inside other type +classes_classvar.py:66: error: Type in ClassVar[...] can only be omitted if there is an initializer +classes_classvar.py:69: error: ClassVar can only be used for assignments in class body +classes_classvar.py:70: error: ClassVar can only be used for assignments in class body +classes_classvar.py:71: error: ClassVar can only be used for assignments in class body +classes_classvar.py:73: error: ClassVar can only be used for assignments in class body +classes_classvar.py:77: error: ClassVar can only be used for assignments in class body +classes_classvar.py:78: error: ClassVar can only be used for assignments in class body +classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance +classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") +classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:140: note: z +""" diff --git a/conformance/results/zuban/classes_override.toml b/conformance/results/zuban/classes_override.toml new file mode 100644 index 000000000..cd420c0b1 --- /dev/null +++ b/conformance/results/zuban/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name +classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name +classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name +classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name +classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name +""" diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml new file mode 100644 index 000000000..1f5db5904 --- /dev/null +++ b/conformance/results/zuban/constructors_call_init.toml @@ -0,0 +1,15 @@ +conformant = "Partial" +notes = """ +Does not report errors during binding to self parameter of __init__ method. +Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 56: Expected 1 errors +Line 107: Expected 1 errors +""" +output = """ +constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" +constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Self | None" +constructors_call_init.py:130: error: Too many arguments for "Class11" +""" diff --git a/conformance/results/zuban/constructors_call_metaclass.toml b/conformance/results/zuban/constructors_call_metaclass.toml new file mode 100644 index 000000000..87caf96ab --- /dev/null +++ b/conformance/results/zuban/constructors_call_metaclass.toml @@ -0,0 +1,18 @@ +conformant = "Unupported" +notes = """ +Does not honor metaclass __call__ method when evaluating constructor call. +Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never"', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1"'] +Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2"', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2"'] +""" +output = """ +constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" +constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" +constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" +constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" +constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" +constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" +""" diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml new file mode 100644 index 000000000..22f9a6d9a --- /dev/null +++ b/conformance/results/zuban/constructors_call_new.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not support __new__ return type that is not a subclass of the class being constructed. +Does not skip evaluation of __init__ based on __new__ return type. +Does not report errors during binding to cls parameter of __new__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 145: Expected 1 errors +Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3")'] +Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int"', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3"'] +Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any")'] +Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any"', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4"'] +Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never"', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5"'] +Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6")'] +Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6"', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6"'] +""" +output = """ +constructors_call_new.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" +constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") +constructors_call_new.py:49: error: Expression is of type "Class3", not "int" +constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" +constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") +constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" +constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" +constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" +constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" +constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") +constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" +constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" +""" diff --git a/conformance/results/zuban/constructors_call_type.toml b/conformance/results/zuban/constructors_call_type.toml new file mode 100644 index 000000000..27868a835 --- /dev/null +++ b/conformance/results/zuban/constructors_call_type.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not validate call to custom metaclass __call__ method through type[T]. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 30: Expected 1 errors +Line 72: Expected 1 errors +""" +output = """ +constructors_call_type.py:40: error: Missing positional arguments "x", "y" in call to "Class2" +constructors_call_type.py:50: error: Missing positional arguments "x", "y" in call to "Class3" +constructors_call_type.py:59: error: Too many arguments for "Class4" +constructors_call_type.py:64: error: Too many arguments for "object" +constructors_call_type.py:81: error: Missing positional argument "y" in call to "Class2" +constructors_call_type.py:82: error: Argument 2 to "Class2" has incompatible type "int"; expected "str" +""" diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml new file mode 100644 index 000000000..2bbc76b36 --- /dev/null +++ b/conformance/results/zuban/constructors_callable.toml @@ -0,0 +1,59 @@ +conformant = "Partial" +notes = """ +Does not generate a union type for __new__ and __init__ when converting class to callable. +Does not ignore __init__ based on __new__ return type when converting class to callable. +Does not support __new__ return type that is different from class being constructed. +Struggles with some cases of self types +""" +conformance_automated = "Fail" +errors_diff = """ +Line 127: Expected 1 errors +Line 144: Expected 1 errors +Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4")'] +Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never"'] +Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never"'] +Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6")'] +Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy"', 'constructors_callable.py:126: error: Missing positional argument "x" in call'] +Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any"', 'constructors_callable.py:143: error: Missing positional argument "x" in call'] +Line 160: Unexpected errors ['constructors_callable.py:160: error: Need type annotation for "r7"'] +Line 164: Unexpected errors ['constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]"'] +Line 165: Unexpected errors ['constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]"', 'constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int"'] +Line 194: Unexpected errors ['constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"', 'constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"'] +""" +output = """ +constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" +constructors_callable.py:38: error: Missing positional argument "x" in call +constructors_callable.py:39: error: Unexpected keyword argument "y" +constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2" +constructors_callable.py:51: error: Too many arguments +constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" +constructors_callable.py:65: error: Missing positional argument "x" in call +constructors_callable.py:66: error: Unexpected keyword argument "y" +constructors_callable.py:67: error: Too many arguments +constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") +constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> builtins.int" +constructors_callable.py:79: error: Missing positional argument "x" in call +constructors_callable.py:80: error: Unexpected keyword argument "y" +constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" +constructors_callable.py:100: error: Expression is of type "Class5", not "Never" +constructors_callable.py:105: error: Expression is of type "Class5", not "Never" +constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") +constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" +constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" +constructors_callable.py:126: error: Missing positional argument "x" in call +constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" +constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" +constructors_callable.py:143: error: Missing positional argument "x" in call +constructors_callable.py:160: error: Need type annotation for "r7" +constructors_callable.py:162: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" +constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" +constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" +constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" +constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" +constructors_callable.py:184: error: List item 0 has incompatible type "str"; expected "int" +constructors_callable.py:193: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" +constructors_callable.py:195: error: List item 0 has incompatible type "int"; expected "T" +constructors_callable.py:195: error: List item 0 has incompatible type "str"; expected "T" +""" diff --git a/conformance/results/zuban/constructors_consistency.toml b/conformance/results/zuban/constructors_consistency.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/constructors_consistency.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_descriptors.toml b/conformance/results/zuban/dataclasses_descriptors.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/dataclasses_descriptors.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_final.toml b/conformance/results/zuban/dataclasses_final.toml new file mode 100644 index 000000000..637d07db2 --- /dev/null +++ b/conformance/results/zuban/dataclasses_final.toml @@ -0,0 +1,21 @@ +conformant = "Partial" +notes = """ +Wrongly requires a Final dataclass field to be initialized at class level. +Doesn't support Final nested inside ClassVar. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 27: Expected 1 errors +Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value'] +Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation'] +Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int"'] +""" +output = """ +dataclasses_final.py:16: error: Final name must be initialized with a value +dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation +dataclasses_final.py:24: error: Expression is of type "Any", not "int" +dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_default" +dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" +dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" +dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" +""" diff --git a/conformance/results/zuban/dataclasses_frozen.toml b/conformance/results/zuban/dataclasses_frozen.toml new file mode 100644 index 000000000..bd41573c9 --- /dev/null +++ b/conformance/results/zuban/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only +dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only +dataclasses_frozen.py:23: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_frozen.py:33: error: Frozen dataclass cannot inherit from a non-frozen dataclass +""" diff --git a/conformance/results/zuban/dataclasses_hash.toml b/conformance/results/zuban/dataclasses_hash.toml new file mode 100644 index 000000000..1e0314518 --- /dev/null +++ b/conformance/results/zuban/dataclasses_hash.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Does not report when dataclass is not compatible with Hashable protocol. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 32: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_inheritance.toml b/conformance/results/zuban/dataclasses_inheritance.toml new file mode 100644 index 000000000..8ca154124 --- /dev/null +++ b/conformance/results/zuban/dataclasses_inheritance.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_inheritance.py:62: error: Cannot override instance variable (previously declared on base class "DC6") with class variable +dataclasses_inheritance.py:66: error: Cannot override class variable (previously declared on base class "DC6") with instance variable +""" diff --git a/conformance/results/zuban/dataclasses_kwonly.toml b/conformance/results/zuban/dataclasses_kwonly.toml new file mode 100644 index 000000000..9037fe428 --- /dev/null +++ b/conformance/results/zuban/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" +dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" +dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" +""" diff --git a/conformance/results/zuban/dataclasses_order.toml b/conformance/results/zuban/dataclasses_order.toml new file mode 100644 index 000000000..52acf1978 --- /dev/null +++ b/conformance/results/zuban/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_order.py:50: error: Unsupported operand types for < ("DC1" and "DC2") +""" diff --git a/conformance/results/zuban/dataclasses_postinit.toml b/conformance/results/zuban/dataclasses_postinit.toml new file mode 100644 index 000000000..2f08fcabb --- /dev/null +++ b/conformance/results/zuban/dataclasses_postinit.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_postinit.py:19: error: Argument 2 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" +dataclasses_postinit.py:28: error: "DC1" has no attribute "x" +dataclasses_postinit.py:29: error: "DC1" has no attribute "y" +dataclasses_postinit.py:36: error: Signature of "__post_init__" incompatible with supertype "dataclass" +dataclasses_postinit.py:36: note: Superclass: +dataclasses_postinit.py:36: note: def __post_init__(self, x: int, y: str) -> None +dataclasses_postinit.py:36: note: Subclass: +dataclasses_postinit.py:36: note: def __post_init__(self, x: int) -> None +""" diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml new file mode 100644 index 000000000..9c236711c --- /dev/null +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not reject write to instance variable that is not defined in __slots__. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 25: Expected 1 errors +""" +output = """ +dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" +dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" +dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" +dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" +""" diff --git a/conformance/results/zuban/dataclasses_transform_class.toml b/conformance/results/zuban/dataclasses_transform_class.toml new file mode 100644 index 000000000..8aeb303ed --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_class.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" +dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" +dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml new file mode 100644 index 000000000..32952f2a8 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -0,0 +1,50 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 118: Expected 1 errors +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass"', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int"'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass")'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass")'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass"', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]"'] +""" +output = """ +dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" +dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars +dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" +dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" +dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" +dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" +dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") +dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") +dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") +dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") +dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" +dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" +dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" +dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" +""" diff --git a/conformance/results/zuban/dataclasses_transform_field.toml b/conformance/results/zuban/dataclasses_transform_field.toml new file mode 100644 index 000000000..26b9ea8c4 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_field.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" +dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" +""" diff --git a/conformance/results/zuban/dataclasses_transform_func.toml b/conformance/results/zuban/dataclasses_transform_func.toml new file mode 100644 index 000000000..2c2a8e822 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_func.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") +dataclasses_transform_func.py:61: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" +dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" +dataclasses_transform_func.py:90: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_transform_meta.toml b/conformance/results/zuban/dataclasses_transform_meta.toml new file mode 100644 index 000000000..91a673e7e --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_meta.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" +dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" +dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_usage.toml b/conformance/results/zuban/dataclasses_usage.toml new file mode 100644 index 000000000..657b30298 --- /dev/null +++ b/conformance/results/zuban/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_usage.py:50: error: Missing positional argument "unit_price" in call to "InventoryItem" +dataclasses_usage.py:51: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" +dataclasses_usage.py:52: error: Too many arguments for "InventoryItem" +dataclasses_usage.py:61: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:83: error: Too many arguments for "DC4" +dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" +dataclasses_usage.py:127: error: Too many arguments for "DC7" +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" +dataclasses_usage.py:179: error: Too many arguments for "DC13" +""" diff --git a/conformance/results/zuban/directives_assert_type.toml b/conformance/results/zuban/directives_assert_type.toml new file mode 100644 index 000000000..cb5f42c91 --- /dev/null +++ b/conformance/results/zuban/directives_assert_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_assert_type.py:27: error: Expression is of type "int | str", not "int" +directives_assert_type.py:28: error: Expression is of type "Any", not "int" +directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" +directives_assert_type.py:31: error: "assert_type" expects 2 arguments +directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" +directives_assert_type.py:33: error: "assert_type" expects 2 arguments +""" diff --git a/conformance/results/zuban/directives_cast.toml b/conformance/results/zuban/directives_cast.toml new file mode 100644 index 000000000..2929dc71c --- /dev/null +++ b/conformance/results/zuban/directives_cast.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_cast.py:15: error: "cast" expects 2 arguments +directives_cast.py:16: error: Invalid type: try using Literal[1] instead? +directives_cast.py:17: error: "cast" expects 2 arguments +""" diff --git a/conformance/results/zuban/directives_deprecated.toml b/conformance/results/zuban/directives_deprecated.toml new file mode 100644 index 000000000..2b3718261 --- /dev/null +++ b/conformance/results/zuban/directives_deprecated.toml @@ -0,0 +1,18 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 18: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_no_type_check.toml b/conformance/results/zuban/directives_no_type_check.toml new file mode 100644 index 000000000..ffa3b903a --- /dev/null +++ b/conformance/results/zuban/directives_no_type_check.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_no_type_check.py:15: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_no_type_check.py:32: error: Missing positional arguments "a", "b" in call to "func1" +""" diff --git a/conformance/results/zuban/directives_reveal_type.toml b/conformance/results/zuban/directives_reveal_type.toml new file mode 100644 index 000000000..ca00eb927 --- /dev/null +++ b/conformance/results/zuban/directives_reveal_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_reveal_type.py:14: note: Revealed type is "builtins.int | builtins.str" +directives_reveal_type.py:15: note: Revealed type is "builtins.list[builtins.int]" +directives_reveal_type.py:16: note: Revealed type is "Any" +directives_reveal_type.py:17: note: Revealed type is "directives_reveal_type.ForwardReference" +directives_reveal_type.py:19: error: Too few arguments for "reveal_type" +directives_reveal_type.py:20: error: Too many arguments for "reveal_type" +""" diff --git a/conformance/results/zuban/directives_type_checking.toml b/conformance/results/zuban/directives_type_checking.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/directives_type_checking.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_type_ignore.toml b/conformance/results/zuban/directives_type_ignore.toml new file mode 100644 index 000000000..4de75baee --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not honor "# type: ignore" comment if comment includes additional text. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +Line 14: Unexpected errors ['directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +""" +output = """ +directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore.py:14: note: Error code "assignment" not covered by "type: ignore" comment +""" diff --git a/conformance/results/zuban/directives_type_ignore_file1.toml b/conformance/results/zuban/directives_type_ignore_file1.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore_file1.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_type_ignore_file2.toml b/conformance/results/zuban/directives_type_ignore_file2.toml new file mode 100644 index 000000000..8a3521e92 --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore_file2.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file2.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +""" diff --git a/conformance/results/zuban/directives_version_platform.toml b/conformance/results/zuban/directives_version_platform.toml new file mode 100644 index 000000000..01082d4b6 --- /dev/null +++ b/conformance/results/zuban/directives_version_platform.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") +""" diff --git a/conformance/results/zuban/enums_behaviors.toml b/conformance/results/zuban/enums_behaviors.toml new file mode 100644 index 000000000..1328d68ab --- /dev/null +++ b/conformance/results/zuban/enums_behaviors.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" +enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" +enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" +""" diff --git a/conformance/results/zuban/enums_definition.toml b/conformance/results/zuban/enums_definition.toml new file mode 100644 index 000000000..5fd9eb7c4 --- /dev/null +++ b/conformance/results/zuban/enums_definition.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_definition.py:24: error: Too many arguments for Enum() +""" diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml new file mode 100644 index 000000000..aac06a242 --- /dev/null +++ b/conformance/results/zuban/enums_expansion.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Improperly applies narrowing to Flag subclass. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags"'] +""" +output = """ +enums_expansion.py:35: error: Expression is of type "Color", not "Never" +enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" +""" diff --git a/conformance/results/zuban/enums_member_names.toml b/conformance/results/zuban/enums_member_names.toml new file mode 100644 index 000000000..7026fbd73 --- /dev/null +++ b/conformance/results/zuban/enums_member_names.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_names.py:30: error: Expression is of type "str", not "Literal['RED', 'BLUE', 'GREEN']" +""" diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml new file mode 100644 index 000000000..0898b966a --- /dev/null +++ b/conformance/results/zuban/enums_member_values.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not enforce declared type of `_value_`. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +""" +output = """ +enums_member_values.py:54: error: Expression is of type "tuple[Literal[1], float, float]", not "Literal[1]" +enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" +enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") +enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" +""" diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml new file mode 100644 index 000000000..a9c41a462 --- /dev/null +++ b/conformance/results/zuban/enums_members.toml @@ -0,0 +1,30 @@ +conformant = "Partial" +notes = """ +Does not honor `enum.member` as method decorator. +Does not properly handle aliased enum members. +Does not treat somecallables as non-members. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str"'] +Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str"'] +Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]"'] +Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid'] +""" +output = """ +enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" +enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" +enums_members.py:50: error: Enum members must be left unannotated +enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members +enums_members.py:84: error: Parameter 1 of Literal[...] is invalid +enums_members.py:85: error: Parameter 1 of Literal[...] is invalid +enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" +enums_members.py:117: error: Parameter 1 of Literal[...] is invalid +enums_members.py:128: note: Revealed type is "builtins.int" +enums_members.py:129: error: Parameter 1 of Literal[...] is invalid +enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" +enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" +""" diff --git a/conformance/results/zuban/exceptions_context_managers.toml b/conformance/results/zuban/exceptions_context_managers.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/exceptions_context_managers.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml new file mode 100644 index 000000000..486fb5e8c --- /dev/null +++ b/conformance/results/zuban/generics_base_class.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Does not detect inconsistent type variable ordering in multi-inheritance. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]"'] +""" +output = """ +generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" +generics_base_class.py:29: error: Invalid type +generics_base_class.py:30: error: Invalid type +generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" +generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given +generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given +generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] +""" diff --git a/conformance/results/zuban/generics_basic.toml b/conformance/results/zuban/generics_basic.toml new file mode 100644 index 000000000..db0b02d3a --- /dev/null +++ b/conformance/results/zuban/generics_basic.toml @@ -0,0 +1,18 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_basic.py:40: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" +generics_basic.py:41: error: Argument 2 to "concat" has incompatible type "str"; expected "bytes" +generics_basic.py:49: error: Type variable must have at least two constrained types +generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables +generics_basic.py:69: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" +generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] +generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" +generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" +generics_basic.py:162: error: Free type variable expected in Generic[...] +generics_basic.py:163: error: Free type variable expected in Protocol[...] +generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables +generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables +generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" +""" diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml new file mode 100644 index 000000000..76fad1289 --- /dev/null +++ b/conformance/results/zuban/generics_defaults.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +conformance_automated = "Fail" +errors_diff = """ +Line 141: Expected 1 errors +Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]"', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str"'] +Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]"'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous'] +""" +output = """ +generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type +generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given +generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type +generics_defaults.py:114: error: TypeVar default must be one of the constraint types +generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" +generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" +generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" +generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_defaults_referential.toml b/conformance/results/zuban/generics_defaults_referential.toml new file mode 100644 index 000000000..f5dc26363 --- /dev/null +++ b/conformance/results/zuban/generics_defaults_referential.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" +generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" +generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types +generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types +""" diff --git a/conformance/results/zuban/generics_defaults_specialization.toml b/conformance/results/zuban/generics_defaults_specialization.toml new file mode 100644 index 000000000..29f44e4f7 --- /dev/null +++ b/conformance/results/zuban/generics_defaults_specialization.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 +generics_defaults_specialization.py:55: error: "Foo" expects no type arguments, but 1 given +""" diff --git a/conformance/results/zuban/generics_paramspec_basic.toml b/conformance/results/zuban/generics_paramspec_basic.toml new file mode 100644 index 000000000..97048c7ba --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_basic.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" +generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:27: error: Invalid location for Concatenate +generics_paramspec_basic.py:27: note: You can use Concatenate as the first argument to Callable +generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +""" diff --git a/conformance/results/zuban/generics_paramspec_components.toml b/conformance/results/zuban/generics_paramspec_components.toml new file mode 100644 index 000000000..5c8e9bfea --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_components.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter +generics_paramspec_components.py:17: error: Use "P.kwargs" for variadic "**" parameter +generics_paramspec_components.py:20: error: ParamSpec components are not allowed here +generics_paramspec_components.py:23: error: Use "P.kwargs" for variadic "**" parameter +generics_paramspec_components.py:26: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:30: error: ParamSpec "P" is unbound +generics_paramspec_components.py:35: error: ParamSpec components are not allowed here +generics_paramspec_components.py:36: error: ParamSpec components are not allowed here +generics_paramspec_components.py:38: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:41: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:49: error: Argument 1 has incompatible type "*P.kwargs"; expected "P.args" +generics_paramspec_components.py:49: error: Argument after ** must be a mapping, not "P.args" +generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" +generics_paramspec_components.py:60: error: Arguments not allowed after ParamSpec.args +generics_paramspec_components.py:70: error: Too few arguments +generics_paramspec_components.py:70: error: ParamSpec arguments must be of types "*P.args, **P.kwargs" +generics_paramspec_components.py:70: error: Argument 3 has incompatible type "**P.kwargs"; expected "P.kwargs" +generics_paramspec_components.py:72: error: Too few arguments +generics_paramspec_components.py:83: error: Argument "x" to "foo" has incompatible type "int"; expected "P.args" +generics_paramspec_components.py:83: error: Argument 2 to "foo" has incompatible type "*P.args"; expected "int" +generics_paramspec_components.py:98: error: Argument 2 to "twice" has incompatible type "str"; expected "int" +generics_paramspec_components.py:98: error: Argument 3 to "twice" has incompatible type "int"; expected "str" +""" diff --git a/conformance/results/zuban/generics_paramspec_semantics.toml b/conformance/results/zuban/generics_paramspec_semantics.toml new file mode 100644 index 000000000..d25400dca --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_semantics.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" +generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" +generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" +generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" +generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" +generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" +generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, Never], int]" +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, Never], int]" +""" diff --git a/conformance/results/zuban/generics_paramspec_specialization.toml b/conformance/results/zuban/generics_paramspec_specialization.toml new file mode 100644 index 000000000..aa32f55b0 --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_specialization.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" +generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" +generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" +generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" +""" diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml new file mode 100644 index 000000000..4d20365fd --- /dev/null +++ b/conformance/results/zuban/generics_scoping.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +False negative on generic class nested within generic class with same type variable. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 80: Unexpected errors ['generics_scoping.py:80: error: Type variable "T" is bound by an outer class'] +""" +output = """ +generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" +generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:50: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:50: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:65: error: Free type variable expected in Generic[...] +generics_scoping.py:75: error: Type variable "T" is bound by an outer class +generics_scoping.py:78: error: Type variable "T" is bound by an outer class +generics_scoping.py:80: error: Type variable "T" is bound by an outer class +generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias +generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) +""" diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml new file mode 100644 index 000000000..ddd4e1d21 --- /dev/null +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +notes = """ +True positive: Writing to a variable that contains Self (with a class) should error +""" +conformance_automated = "Fail" +errors_diff = """ +Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous'] +""" +output = """ +generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous +generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_self_attributes.toml b/conformance/results/zuban/generics_self_attributes.toml new file mode 100644 index 000000000..1c95e98a6 --- /dev/null +++ b/conformance/results/zuban/generics_self_attributes.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_attributes.py:26: error: Argument "next" to "OrdinalLinkedList" has incompatible type "LinkedList[int]"; expected "OrdinalLinkedList | None" +generics_self_attributes.py:32: error: Incompatible types in assignment (expression has type "LinkedList[int]", variable has type "OrdinalLinkedList | None") +""" diff --git a/conformance/results/zuban/generics_self_basic.toml b/conformance/results/zuban/generics_self_basic.toml new file mode 100644 index 000000000..60e1b62b2 --- /dev/null +++ b/conformance/results/zuban/generics_self_basic.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") +generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") +generics_self_basic.py:67: error: Self type cannot have type arguments +""" diff --git a/conformance/results/zuban/generics_self_protocols.toml b/conformance/results/zuban/generics_self_protocols.toml new file mode 100644 index 000000000..b62c21667 --- /dev/null +++ b/conformance/results/zuban/generics_self_protocols.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_protocols.py:61: error: Argument 1 to "accepts_shape" has incompatible type "BadReturnType"; expected "ShapeProtocol" +generics_self_protocols.py:61: note: Following member(s) of "BadReturnType" have conflicts: +generics_self_protocols.py:61: note: Expected: +generics_self_protocols.py:61: note: def [Self: BadReturnType] set_scale(self, scale: float) -> Self +generics_self_protocols.py:61: note: Got: +generics_self_protocols.py:61: note: def set_scale(self, scale: float) -> int +generics_self_protocols.py:64: error: Argument 1 to "accepts_shape" has incompatible type "ReturnDifferentClass"; expected "ShapeProtocol" +generics_self_protocols.py:64: note: Following member(s) of "ReturnDifferentClass" have conflicts: +generics_self_protocols.py:64: note: Expected: +generics_self_protocols.py:64: note: def [Self: ReturnDifferentClass] set_scale(self, scale: float) -> Self +generics_self_protocols.py:64: note: Got: +generics_self_protocols.py:64: note: def set_scale(self, scale: float) -> ReturnConcreteShape +""" diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml new file mode 100644 index 000000000..b3c5b50f8 --- /dev/null +++ b/conformance/results/zuban/generics_self_usage.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Does not detect invalid Self when Self is not properly bound""" +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +Line 111: Expected 1 errors +Line 116: Expected 1 errors +Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]")'] +""" +output = """ +generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") +generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:106: error: Self type cannot be used in type alias target +generics_self_usage.py:121: error: Self type cannot be used in a metaclass +generics_self_usage.py:125: error: Self type cannot be used in a metaclass +""" diff --git a/conformance/results/zuban/generics_syntax_compatibility.toml b/conformance/results/zuban/generics_syntax_compatibility.toml new file mode 100644 index 000000000..77ec435b5 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_compatibility.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_compatibility.py:14: error: All type parameters should be declared ("K" not declared) +generics_syntax_compatibility.py:26: error: All type parameters should be declared ("K" not declared) +""" diff --git a/conformance/results/zuban/generics_syntax_declarations.toml b/conformance/results/zuban/generics_syntax_declarations.toml new file mode 100644 index 000000000..c497a4436 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_declarations.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_declarations.py:17: error: Generic[...] base class is redundant +generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class +generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" +generics_syntax_declarations.py:44: error: "V" may not be used, because it's defined in an outer class +generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type +generics_syntax_declarations.py:48: note: Did you mean "List[...]"? +generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types +generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types +generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type +generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? +generics_syntax_declarations.py:79: error: Name "S" is not defined +""" diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml new file mode 100644 index 000000000..cf981f5ec --- /dev/null +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -0,0 +1,67 @@ +conformant = "Unsupported" +notes = """ +Type parameter syntax not yet support. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] +Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] +Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given'] +""" +output = """ +generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +""" diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml new file mode 100644 index 000000000..d00420b47 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Does not following runtime scoping rules for type parameters in all cases. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound'] +Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55'] +Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str"'] +Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]"'] +Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89'] +Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105'] +Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int"'] +Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar"'] +Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex"'] +Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex"'] +""" +output = """ +generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type +generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound +generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_syntax_scoping.py:35: error: Name "T" is used before definition +generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" +generics_syntax_scoping.py:44: error: Name "T" is used before definition +generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 +generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" +generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" +generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 +generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 +generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" +generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" +generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" +generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" +""" diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml new file mode 100644 index 000000000..01da12864 --- /dev/null +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -0,0 +1,20 @@ +conformant = "Pass" +notes = """ +True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any) +""" +conformance_automated = "Fail" +errors_diff = """ +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]"'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any"'] +""" +output = """ +generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" +generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" +generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" +generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_typevartuple_args.toml b/conformance/results/zuban/generics_typevartuple_args.toml new file mode 100644 index 000000000..1253bce91 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not enforce that tuples captured by TypeVarTuple are same type. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 75: Expected 1 errors +Line 76: Expected 1 errors +""" +output = """ +generics_typevartuple_args.py:33: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" +generics_typevartuple_args.py:34: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" +generics_typevartuple_args.py:48: error: Argument 2 to "func1" has incompatible type "str"; expected "int" +generics_typevartuple_args.py:57: error: Argument 2 to "func2" has incompatible type "int"; expected "str" +generics_typevartuple_args.py:58: error: Too few arguments for "func2" +generics_typevartuple_args.py:59: error: Too few arguments for "func2" +generics_typevartuple_args.py:59: error: Argument 1 to "func2" has incompatible type "str"; expected "int" +generics_typevartuple_args.py:67: error: Too few arguments for "func3" +""" diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml new file mode 100644 index 000000000..300c70d5b --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not enforce that tuples captured by TypeVarTuple are same length. +Does not enforce that tuples captured by TypeVarTuple are same type. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 99: Expected 1 errors +Line 100: Expected 1 errors +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]")'] +Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]")'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]"'] +""" +output = """ +generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" +generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] +generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") +generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") +generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" +generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" +generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" +generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" +generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def +""" diff --git a/conformance/results/zuban/generics_typevartuple_callable.toml b/conformance/results/zuban/generics_typevartuple_callable.toml new file mode 100644 index 000000000..6692b4b4f --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_callable.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_callable.py:26: error: Argument "args" to "Process" has incompatible type "tuple[str, int]"; expected "tuple[int, str]" +""" diff --git a/conformance/results/zuban/generics_typevartuple_concat.toml b/conformance/results/zuban/generics_typevartuple_concat.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_concat.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_typevartuple_overloads.toml b/conformance/results/zuban/generics_typevartuple_overloads.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_overloads.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_typevartuple_specialization.toml b/conformance/results/zuban/generics_typevartuple_specialization.toml new file mode 100644 index 000000000..0ace1caab --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_specialization.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position +generics_typevartuple_specialization.py:109: error: TypeVarTuple "Ts" is unbound +generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position +generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed +generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed +generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 2 +generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split +""" diff --git a/conformance/results/zuban/generics_typevartuple_unpack.toml b/conformance/results/zuban/generics_typevartuple_unpack.toml new file mode 100644 index 000000000..4f43a5231 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_unpack.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_unpack.py:30: error: Argument 1 to "process_batch_channels" has incompatible type "Array[Batch]"; expected "Array[Batch, Unpack[Tuple[Any, ...]], Channels]" +""" diff --git a/conformance/results/zuban/generics_upper_bound.toml b/conformance/results/zuban/generics_upper_bound.toml new file mode 100644 index 000000000..60e86bbaf --- /dev/null +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Does not reject use of type variable within an upper bound. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +""" +output = """ +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" +generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound +""" diff --git a/conformance/results/zuban/generics_variance.toml b/conformance/results/zuban/generics_variance.toml new file mode 100644 index 000000000..a363a8378 --- /dev/null +++ b/conformance/results/zuban/generics_variance.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 113: Expected 1 errors +Line 163: Expected 1 errors +Line 167: Expected 1 errors +Line 191: Expected 1 errors +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') +""" +output = """ +generics_variance.py:14: error: TypeVar cannot be both covariant and contravariant +generics_variance.py:77: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:81: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +generics_variance.py:93: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +generics_variance.py:105: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:126: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:132: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +""" diff --git a/conformance/results/zuban/generics_variance_inference.toml b/conformance/results/zuban/generics_variance_inference.toml new file mode 100644 index 000000000..1ffa25b3b --- /dev/null +++ b/conformance/results/zuban/generics_variance_inference.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") +generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") +generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") +generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") +generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") +generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") +generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") +generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") +generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") +generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") +generics_variance_inference.py:111: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") +generics_variance_inference.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") +generics_variance_inference.py:119: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") +generics_variance_inference.py:120: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") +generics_variance_inference.py:121: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") +generics_variance_inference.py:122: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") +generics_variance_inference.py:130: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") +generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") +generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") +generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") +generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") +generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") +generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") +""" diff --git a/conformance/results/zuban/historical_positional.toml b/conformance/results/zuban/historical_positional.toml new file mode 100644 index 000000000..50a395d0d --- /dev/null +++ b/conformance/results/zuban/historical_positional.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not reject positional-only parameter after non-positional-only parameter. +Treats keyword-only parameter as positional-only. +Applies legacy positional-only rules when PEP 570 syntax is used. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 26: Expected 1 errors +Line 38: Expected 1 errors +Line 53: Unexpected errors ['historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4"'] +""" +output = """ +historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" +historical_positional.py:43: error: Unexpected keyword argument "__x" for "m1" of "A" +historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" +""" diff --git a/conformance/results/zuban/literals_interactions.toml b/conformance/results/zuban/literals_interactions.toml new file mode 100644 index 000000000..8beb65e72 --- /dev/null +++ b/conformance/results/zuban/literals_interactions.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not narrow type of `x` with `x in Literal` type guard pattern. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 106: Unexpected errors ['literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal[\\'MALFORMED\\', \\'ABORTED\\']"'] +Line 109: Unexpected errors ['literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal[\\'PENDING\\']"'] +""" +output = """ +literals_interactions.py:15: error: Tuple index out of range +literals_interactions.py:16: error: Tuple index out of range +literals_interactions.py:17: error: Tuple index out of range +literals_interactions.py:18: error: Tuple index out of range +literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal['MALFORMED', 'ABORTED']" +literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal['PENDING']" +""" diff --git a/conformance/results/zuban/literals_literalstring.toml b/conformance/results/zuban/literals_literalstring.toml new file mode 100644 index 000000000..fbc6b507f --- /dev/null +++ b/conformance/results/zuban/literals_literalstring.toml @@ -0,0 +1,22 @@ +conformant = "Unsupported" +notes = """ +Support for `LiteralString` is not implemented. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 66: Expected 1 errors +Line 120: Expected 1 errors +Line 134: Expected 1 errors +Line 171: Expected 1 errors +Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader"] +Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A"'] +""" +output = """ +literals_literalstring.py:36: error: Parameter 2 of Literal[...] is invalid +literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid +literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") +literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") +literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") +literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader +literals_literalstring.py:167: error: Expression is of type "B", not "A" +""" diff --git a/conformance/results/zuban/literals_parameterizations.toml b/conformance/results/zuban/literals_parameterizations.toml new file mode 100644 index 000000000..06c6df1b4 --- /dev/null +++ b/conformance/results/zuban/literals_parameterizations.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_parameterizations.py:41: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:46: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:50: error: Type variable "literals_parameterizations.T" is unbound +literals_parameterizations.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +literals_parameterizations.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) +literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" +literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" +literals_parameterizations.py:53: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:60: error: Literal[...] must have at least one parameter +literals_parameterizations.py:61: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:65: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") +""" diff --git a/conformance/results/zuban/literals_semantics.toml b/conformance/results/zuban/literals_semantics.toml new file mode 100644 index 000000000..053b2add6 --- /dev/null +++ b/conformance/results/zuban/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_semantics.py:10: error: Incompatible types in assignment (expression has type "Literal[4]", variable has type "Literal[3]") +literals_semantics.py:24: error: Incompatible types in assignment (expression has type "Literal[0]", variable has type "Literal[False]") +literals_semantics.py:25: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Literal[0]") +literals_semantics.py:33: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[3, 4, 5]") +""" diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml new file mode 100644 index 000000000..22fde13ae --- /dev/null +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -0,0 +1,21 @@ +conformant = "Partial" +notes = """ +Does not reject override of named tuple attribute in child class. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 79: Expected 1 errors +""" +output = """ +namedtuples_define_class.py:32: error: Tuple index out of range +namedtuples_define_class.py:33: error: Tuple index out of range +namedtuples_define_class.py:44: error: Missing positional argument "y" in call to "Point" +namedtuples_define_class.py:45: error: Missing positional argument "y" in call to "Point" +namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible type "str"; expected "int" +namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" +namedtuples_define_class.py:48: error: Too many arguments for "Point" +namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" +namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields +namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" +namedtuples_define_class.py:105: error: NamedTuple should be a single base +""" diff --git a/conformance/results/zuban/namedtuples_define_functional.toml b/conformance/results/zuban/namedtuples_define_functional.toml new file mode 100644 index 000000000..3c3045694 --- /dev/null +++ b/conformance/results/zuban/namedtuples_define_functional.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_define_functional.py:16: error: Missing positional argument "y" in call to "Point1" +namedtuples_define_functional.py:21: error: Missing positional arguments "x", "y" in call to "Point2" +namedtuples_define_functional.py:26: error: Too many arguments for "Point3" +namedtuples_define_functional.py:31: error: Unexpected keyword argument "z" for "Point4" +namedtuples_define_functional.py:36: error: Argument 2 to "Point5" has incompatible type "str"; expected "int" +namedtuples_define_functional.py:37: error: Too many arguments for "Point5" +namedtuples_define_functional.py:42: error: Argument 2 to "Point6" has incompatible type "str"; expected "int" +namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompatible type "float"; expected "int" +namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" +namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword +namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword +namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" +""" diff --git a/conformance/results/zuban/namedtuples_type_compat.toml b/conformance/results/zuban/namedtuples_type_compat.toml new file mode 100644 index 000000000..958d58be0 --- /dev/null +++ b/conformance/results/zuban/namedtuples_type_compat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_type_compat.py:22: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, int]") +namedtuples_type_compat.py:23: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, str, str]") +""" diff --git a/conformance/results/zuban/namedtuples_usage.toml b/conformance/results/zuban/namedtuples_usage.toml new file mode 100644 index 000000000..1de5df047 --- /dev/null +++ b/conformance/results/zuban/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_usage.py:34: error: Tuple index out of range +namedtuples_usage.py:35: error: Tuple index out of range +namedtuples_usage.py:40: error: Property "x" defined in "Point" is read-only +namedtuples_usage.py:41: error: Unsupported target for indexed assignment ("Point") +namedtuples_usage.py:42: error: NamedTuple attributes cannot be deleted +namedtuples_usage.py:43: error: "Point" has no attribute "__delitem__" +namedtuples_usage.py:52: error: Too many values to unpack (2 expected, 3 provided) +namedtuples_usage.py:53: error: Need more than 3 values to unpack (4 expected) +""" diff --git a/conformance/results/zuban/narrowing_typeguard.toml b/conformance/results/zuban/narrowing_typeguard.toml new file mode 100644 index 000000000..e63346008 --- /dev/null +++ b/conformance/results/zuban/narrowing_typeguard.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument +narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument +narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" +narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" +""" diff --git a/conformance/results/zuban/narrowing_typeis.toml b/conformance/results/zuban/narrowing_typeis.toml new file mode 100644 index 000000000..ff20cda3a --- /dev/null +++ b/conformance/results/zuban/narrowing_typeis.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argument +narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument +narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" +narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" +narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" +narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" +narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" +narrowing_typeis.py:195: error: Narrowed type "str" is not a subtype of input type "int" +narrowing_typeis.py:199: error: Narrowed type "list[int]" is not a subtype of input type "list[object]" +""" diff --git a/conformance/results/zuban/overloads_basic.toml b/conformance/results/zuban/overloads_basic.toml new file mode 100644 index 000000000..d2a447746 --- /dev/null +++ b/conformance/results/zuban/overloads_basic.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_basic.py:39: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" +overloads_basic.py:39: note: Possible overload variants: +overloads_basic.py:39: note: def __getitem__(self, int, /) -> int +overloads_basic.py:39: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes +""" diff --git a/conformance/results/zuban/overloads_consistency.toml b/conformance/results/zuban/overloads_consistency.toml new file mode 100644 index 000000000..41c2ec4fb --- /dev/null +++ b/conformance/results/zuban/overloads_consistency.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 +overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 +""" diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml new file mode 100644 index 000000000..200451cd1 --- /dev/null +++ b/conformance/results/zuban/overloads_definitions.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions.py:15: error: Single overload definition, multiple required +overloads_definitions.py:28: error: An overloaded function outside a stub file must have an implementation +overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation +overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. +overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. +overloads_definitions.py:122: error: @final should be applied only to overload implementation +overloads_definitions.py:136: error: @final should be applied only to overload implementation +overloads_definitions.py:141: error: @final should be applied only to overload implementation +overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") +overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name +overloads_definitions.py:221: error: @override should be applied only to overload implementation +overloads_definitions.py:225: error: @override should be applied only to overload implementation +""" diff --git a/conformance/results/zuban/overloads_definitions_stub.toml b/conformance/results/zuban/overloads_definitions_stub.toml new file mode 100644 index 000000000..8bb641f43 --- /dev/null +++ b/conformance/results/zuban/overloads_definitions_stub.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required +overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. +overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. +overloads_definitions_stub.pyi:72: error: In a stub file @final must be applied only to the first overload +overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload +overloads_definitions_stub.pyi:107: error: Cannot override final attribute "final_method" (previously declared in base class "Base") +overloads_definitions_stub.pyi:120: error: Method "bad_override" is marked as an override, but no base method was found with this name +overloads_definitions_stub.pyi:146: error: In a stub file @override must be applied only to the first overload +""" diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml new file mode 100644 index 000000000..45c1a5e73 --- /dev/null +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -0,0 +1,53 @@ +conformant = "Partial" +notes = """ +Does not expand boolean arguments to Literal[True] and Literal[False]. +Does not expand enum arguments to literal variants. +Does not expand tuple arguments to possible combinations. +Does not evaluate Any in some cases where overload is ambiguous. +Evaluates Any in some cases where overload is not ambiguous. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool"'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]"'] +Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color"'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]"'] +Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]"'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str"'] +Line 261: Unexpected errors ['overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]"'] +Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any"'] +Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any"'] +Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any"'] +""" +output = """ +overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument +overloads_evaluation.py:38: note: Possible overload variants: +overloads_evaluation.py:38: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:38: note: def example1_1(x: str) -> str +overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" +overloads_evaluation.py:46: note: Possible overload variants: +overloads_evaluation.py:46: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:46: note: def example1_1(x: str) -> str +overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" +overloads_evaluation.py:51: note: Possible overload variants: +overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:51: note: def example1_1(x: str) -> str +overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" +overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" +overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" +overloads_evaluation.py:134: note: Possible overload variants: +overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" +overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" +overloads_evaluation.py:160: note: Possible overload variants: +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" +overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" +overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" +overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" +overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" +overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" +overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" +""" diff --git a/conformance/results/zuban/protocols_class_objects.toml b/conformance/results/zuban/protocols_class_objects.toml new file mode 100644 index 000000000..29f10b1b2 --- /dev/null +++ b/conformance/results/zuban/protocols_class_objects.toml @@ -0,0 +1,25 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected +protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" +protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") +protocols_class_objects.py:58: note: Following member(s) of "ConcreteA" have conflicts: +protocols_class_objects.py:58: note: Expected: +protocols_class_objects.py:58: note: def method1(x: int) -> int +protocols_class_objects.py:58: note: Got: +protocols_class_objects.py:58: note: def method1(self: ConcreteA, x: int) -> int +protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") +protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: +protocols_class_objects.py:74: note: prop1: expected "int", got "property" +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") +protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") +protocols_class_objects.py:106: note: Protocol member ProtoC1.attr1 expected class variable, got instance variable +protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") +protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") +protocols_class_objects.py:108: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +""" diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml new file mode 100644 index 000000000..a1ce5c87c --- /dev/null +++ b/conformance/results/zuban/protocols_definition.toml @@ -0,0 +1,60 @@ +conformant = "Partial" +notes = """ +Does not detect protocol mismatch if concrete method is missing annotations. +Does not detect protocol mismatch if concrete method's parameters are position-only. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 285: Expected 1 errors +Line 286: Expected 1 errors +Line 288: Expected 1 errors +""" +output = """ +protocols_definition.py:30: error: List item 0 has incompatible type "int"; expected "SupportsClose" +protocols_definition.py:67: error: Protocol members cannot be defined via assignment to self +protocols_definition.py:67: error: "Template" has no attribute "temp" +protocols_definition.py:114: error: Incompatible types in assignment (expression has type "Concrete2_Bad1", variable has type "Template2") +protocols_definition.py:115: error: Incompatible types in assignment (expression has type "Concrete2_Bad2", variable has type "Template2") +protocols_definition.py:115: note: Following member(s) of "Concrete2_Bad2" have conflicts: +protocols_definition.py:115: note: val1: expected "Sequence[int]", got "Sequence[float]" +protocols_definition.py:115: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:116: error: Incompatible types in assignment (expression has type "Concrete2_Bad3", variable has type "Template2") +protocols_definition.py:116: note: Following member(s) of "Concrete2_Bad3" have conflicts: +protocols_definition.py:116: note: val1: expected "Sequence[int]", got "list[int]" +protocols_definition.py:116: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:117: error: Incompatible types in assignment (expression has type "Concrete2_Bad4", variable has type "Template2") +protocols_definition.py:117: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:156: error: Incompatible types in assignment (expression has type "Concrete3_Bad1", variable has type "Template3") +protocols_definition.py:157: error: Incompatible types in assignment (expression has type "Concrete3_Bad2", variable has type "Template3") +protocols_definition.py:157: note: Protocol member Template3.val1 expected instance variable, got class variable +protocols_definition.py:158: error: Incompatible types in assignment (expression has type "Concrete3_Bad3", variable has type "Template3") +protocols_definition.py:158: note: Protocol member Template3.val1 expected settable variable, got read-only attribute +protocols_definition.py:159: error: Incompatible types in assignment (expression has type "Concrete3_Bad4", variable has type "Template3") +protocols_definition.py:159: note: Following member(s) of "Concrete3_Bad4" have conflicts: +protocols_definition.py:159: note: val1: expected "Sequence[int]", got "Sequence[float]" +protocols_definition.py:160: error: Incompatible types in assignment (expression has type "Concrete3_Bad5", variable has type "Template3") +protocols_definition.py:160: note: Following member(s) of "Concrete3_Bad5" have conflicts: +protocols_definition.py:160: note: val1: expected "Sequence[int]", got "list[int]" +protocols_definition.py:218: error: Incompatible types in assignment (expression has type "Concrete4_Bad1", variable has type "Template4") +protocols_definition.py:218: note: Following member(s) of "Concrete4_Bad1" have conflicts: +protocols_definition.py:218: note: val1: expected "Sequence[float]", got "Callable[[], Sequence[int]]" +protocols_definition.py:219: error: Incompatible types in assignment (expression has type "Concrete4_Bad2", variable has type "Template4") +protocols_definition.py:287: error: Incompatible types in assignment (expression has type "Concrete5_Bad3", variable has type "Template5") +protocols_definition.py:287: note: Following member(s) of "Concrete5_Bad3" have conflicts: +protocols_definition.py:287: note: Expected: +protocols_definition.py:287: note: def method1(self, a: int, b: int) -> float +protocols_definition.py:287: note: Got: +protocols_definition.py:287: note: def method1(self, *, a: int, b: int) -> float +protocols_definition.py:289: error: Incompatible types in assignment (expression has type "Concrete5_Bad5", variable has type "Template5") +protocols_definition.py:289: note: Following member(s) of "Concrete5_Bad5" have conflicts: +protocols_definition.py:289: note: Expected: +protocols_definition.py:289: note: def method1(self: Template5, a: int, b: int) -> float +protocols_definition.py:289: note: Got: +protocols_definition.py:289: note: def method1(self: Any, a: int, b: int) -> float +protocols_definition.py:339: error: Incompatible types in assignment (expression has type "Concrete6_Bad1", variable has type "Template6") +protocols_definition.py:339: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:340: error: Incompatible types in assignment (expression has type "Concrete6_Bad2", variable has type "Template6") +protocols_definition.py:340: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") +protocols_definition.py:341: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +""" diff --git a/conformance/results/zuban/protocols_explicit.toml b/conformance/results/zuban/protocols_explicit.toml new file mode 100644 index 000000000..3a515ecf3 --- /dev/null +++ b/conformance/results/zuban/protocols_explicit.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Fail" +notes = """ +Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated. +""" +errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors +""" +output = """ +protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe +protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, int, int]") +protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" +protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" +protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" +""" diff --git a/conformance/results/zuban/protocols_generic.toml b/conformance/results/zuban/protocols_generic.toml new file mode 100644 index 000000000..ab3b3ae35 --- /dev/null +++ b/conformance/results/zuban/protocols_generic.toml @@ -0,0 +1,39 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") +protocols_generic.py:40: note: Following member(s) of "Concrete1" have conflicts: +protocols_generic.py:40: note: Expected: +protocols_generic.py:40: note: def method1(self, x: int) -> int +protocols_generic.py:40: note: Got: +protocols_generic.py:40: note: def method1(self, x: str) -> str +protocols_generic.py:40: note: Expected: +protocols_generic.py:40: note: def __iter__(self) -> Iterator[str] +protocols_generic.py:40: note: Got: +protocols_generic.py:40: note: def __iter__(self) -> Iterator[int] +protocols_generic.py:44: error: Only single Generic[...] or Protocol[...] can be in bases +protocols_generic.py:56: error: Incompatible types in assignment (expression has type "Box[float]", variable has type "Box[int]") +protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") +protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") +protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") +protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") +protocols_generic.py:145: note: Following member(s) of "ConcreteHasProperty2" have conflicts: +protocols_generic.py:145: note: Expected: +protocols_generic.py:145: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:145: note: Got: +protocols_generic.py:145: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") +protocols_generic.py:146: note: Following member(s) of "ConcreteHasProperty3" have conflicts: +protocols_generic.py:146: note: f: expected "ConcreteHasProperty3", got "int" +protocols_generic.py:146: note: Expected: +protocols_generic.py:146: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:146: note: Got: +protocols_generic.py:146: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") +protocols_generic.py:147: note: Following member(s) of "ConcreteHasProperty4" have conflicts: +protocols_generic.py:147: note: Expected: +protocols_generic.py:147: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:147: note: Got: +protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str +""" diff --git a/conformance/results/zuban/protocols_merging.toml b/conformance/results/zuban/protocols_merging.toml new file mode 100644 index 000000000..747ee0b5f --- /dev/null +++ b/conformance/results/zuban/protocols_merging.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_merging.py:52: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable1") +protocols_merging.py:52: note: "SCConcrete2" is missing following "SizedAndClosable1" protocol member: +protocols_merging.py:52: note: __len__ +protocols_merging.py:53: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable2") +protocols_merging.py:53: note: "SCConcrete2" is missing following "SizedAndClosable2" protocol member: +protocols_merging.py:53: note: __len__ +protocols_merging.py:54: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable3") +protocols_merging.py:67: error: All bases of a protocol must be protocols +protocols_merging.py:82: error: Cannot instantiate abstract class "SizedAndClosable4" with abstract attribute "close" +protocols_merging.py:83: error: Incompatible types in assignment (expression has type "SCConcrete1", variable has type "SizedAndClosable4") +""" diff --git a/conformance/results/zuban/protocols_modules.toml b/conformance/results/zuban/protocols_modules.toml new file mode 100644 index 000000000..76e6f70f5 --- /dev/null +++ b/conformance/results/zuban/protocols_modules.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_modules.py:26: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Options2") +protocols_modules.py:26: note: Following member(s) of Module "_protocols_modules1" have conflicts: +protocols_modules.py:26: note: timeout: expected "str", got "int" +protocols_modules.py:48: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter2") +protocols_modules.py:48: note: Following member(s) of Module "_protocols_modules2" have conflicts: +protocols_modules.py:48: note: Expected: +protocols_modules.py:48: note: def on_error(x: int) -> int +protocols_modules.py:48: note: Got: +protocols_modules.py:48: note: def on_error(x: int) -> None +protocols_modules.py:49: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter3") +""" diff --git a/conformance/results/zuban/protocols_recursive.toml b/conformance/results/zuban/protocols_recursive.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/protocols_recursive.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/protocols_runtime_checkable.toml b/conformance/results/zuban/protocols_runtime_checkable.toml new file mode 100644 index 000000000..b31703915 --- /dev/null +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not report unsafe overlap for runtime_checkable protocol. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 88: Expected 1 errors +Line 92: Expected 1 errors +Line 96: Expected 1 errors +""" +output = """ +protocols_runtime_checkable.py:23: error: Only @runtime_checkable protocols can be used with instance and class checks +protocols_runtime_checkable.py:55: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:55: note: Protocol "DataProtocol" has non-method member(s): name +protocols_runtime_checkable.py:61: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:61: note: Protocol "DataProtocol" has non-method member(s): name +""" diff --git a/conformance/results/zuban/protocols_self.toml b/conformance/results/zuban/protocols_self.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/protocols_self.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/protocols_subtyping.toml b/conformance/results/zuban/protocols_subtyping.toml new file mode 100644 index 000000000..6ba591cb3 --- /dev/null +++ b/conformance/results/zuban/protocols_subtyping.toml @@ -0,0 +1,34 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_subtyping.py:16: error: Cannot instantiate protocol class "Proto1" +protocols_subtyping.py:38: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Concrete2") +protocols_subtyping.py:55: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Proto3") +protocols_subtyping.py:55: note: "Proto2" is missing following "Proto3" protocol member: +protocols_subtyping.py:55: note: method2 +protocols_subtyping.py:79: error: Incompatible types in assignment (expression has type "Proto5[int]", variable has type "Proto4[int, float]") +protocols_subtyping.py:79: note: Following member(s) of "Proto5[int]" have conflicts: +protocols_subtyping.py:79: note: Expected: +protocols_subtyping.py:79: note: def method1(self, a: int, b: float) -> tuple[int, float] +protocols_subtyping.py:79: note: Got: +protocols_subtyping.py:79: note: def method1(self, a: int, b: int) -> tuple[int, int] +protocols_subtyping.py:80: error: Incompatible types in assignment (expression has type "Proto4[int, int]", variable has type "Proto5[float]") +protocols_subtyping.py:80: note: Following member(s) of "Proto4[int, int]" have conflicts: +protocols_subtyping.py:80: note: Expected: +protocols_subtyping.py:80: note: def method1(self, a: float, b: float) -> tuple[float, float] +protocols_subtyping.py:80: note: Got: +protocols_subtyping.py:80: note: def method1(self, a: int, b: int) -> tuple[int, int] +protocols_subtyping.py:102: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[int, float]") +protocols_subtyping.py:102: note: Following member(s) of "Proto6[float, float]" have conflicts: +protocols_subtyping.py:102: note: Expected: +protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[int] +protocols_subtyping.py:102: note: Got: +protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[float] +protocols_subtyping.py:103: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[float, object]") +protocols_subtyping.py:103: note: Following member(s) of "Proto6[float, float]" have conflicts: +protocols_subtyping.py:103: note: Expected: +protocols_subtyping.py:103: note: def method1(self, a: object) -> Sequence[float] +protocols_subtyping.py:103: note: Got: +protocols_subtyping.py:103: note: def method1(self, a: float) -> Sequence[float] +""" diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml new file mode 100644 index 000000000..c8525a48d --- /dev/null +++ b/conformance/results/zuban/protocols_variance.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected +protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected +protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected +protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected +protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter +protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected +protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected +protocols_variance.py:72: error: Cannot use a contravariant type variable as return type +protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected +""" diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml new file mode 100644 index 000000000..4fd1fd93b --- /dev/null +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type +qualifiers_annotated.py:43: note: Did you mean "List[...]"? +qualifiers_annotated.py:44: error: Syntax error in type annotation +qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? +qualifiers_annotated.py:45: error: Invalid type comment or annotation +qualifiers_annotated.py:46: error: Invalid type comment or annotation +qualifiers_annotated.py:47: error: Invalid type comment or annotation +qualifiers_annotated.py:48: error: Invalid type comment or annotation +qualifiers_annotated.py:49: error: Invalid type comment or annotation +qualifiers_annotated.py:50: error: Name "var1" is not defined +qualifiers_annotated.py:51: error: Invalid type comment or annotation +qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? +qualifiers_annotated.py:53: error: Invalid type comment or annotation +qualifiers_annotated.py:54: error: Invalid type comment or annotation +qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation +qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") +qualifiers_annotated.py:77: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") +qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" +qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" +qualifiers_annotated.py:91: error: "_SpecialForm" not callable +qualifiers_annotated.py:92: error: "_SpecialForm" not callable +qualifiers_annotated.py:93: error: "" not callable +qualifiers_annotated.py:119: error: Name "T" already defined on line 25 +""" diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml new file mode 100644 index 000000000..aa317cadb --- /dev/null +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -0,0 +1,41 @@ +conformant = "Partial" +notes = """ +Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. +Does not allow conditional assignment of Final instance variable in __init__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 134: Expected 1 errors +Line 135: Expected 1 errors +Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6"'] +Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name'] +""" +output = """ +qualifiers_final_annotation.py:16: error: Type in Final[...] can only be omitted if there is an initializer +qualifiers_final_annotation.py:18: error: Final[...] takes at most one type argument +qualifiers_final_annotation.py:34: error: Type in Final[...] can only be omitted if there is an initializer +qualifiers_final_annotation.py:38: error: Final name must be initialized with a value +qualifiers_final_annotation.py:54: error: Cannot assign to final attribute "ID5" +qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" +qualifiers_final_annotation.py:62: error: Can only declare a final attribute in class body or __init__ +qualifiers_final_annotation.py:63: error: Can only declare a final attribute in class body or __init__ +qualifiers_final_annotation.py:65: error: Cannot assign to final attribute "ID7" +qualifiers_final_annotation.py:67: error: Cannot assign to final attribute "ID7" +qualifiers_final_annotation.py:71: error: Cannot assign to final name "RATE" +qualifiers_final_annotation.py:81: error: Cannot assign to final attribute "DEFAULT_ID" +qualifiers_final_annotation.py:94: error: Cannot assign to final name "BORDER_WIDTH" +qualifiers_final_annotation.py:107: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type +qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name +qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" +qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:149: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:152: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") +qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" +qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" +""" diff --git a/conformance/results/zuban/qualifiers_final_decorator.toml b/conformance/results/zuban/qualifiers_final_decorator.toml new file mode 100644 index 000000000..92903082a --- /dev/null +++ b/conformance/results/zuban/qualifiers_final_decorator.toml @@ -0,0 +1,20 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" +qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") +qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") +qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") +qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") +qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") +qualifiers_final_decorator.py:85: error: @final should be applied only to overload implementation +qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") +qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") +qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" +qualifiers_final_decorator.py:118: note: Superclass: +qualifiers_final_decorator.py:118: note: def method(self, v: int) -> None +qualifiers_final_decorator.py:118: note: Subclass: +qualifiers_final_decorator.py:118: note: def method(self) -> None +qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions +""" diff --git a/conformance/results/zuban/specialtypes_any.toml b/conformance/results/zuban/specialtypes_any.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/specialtypes_any.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/specialtypes_never.toml b/conformance/results/zuban/specialtypes_never.toml new file mode 100644 index 000000000..dbdbe2e69 --- /dev/null +++ b/conformance/results/zuban/specialtypes_never.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_never.py:19: error: Implicit return in function which does not return +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") +specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") +""" diff --git a/conformance/results/zuban/specialtypes_none.toml b/conformance/results/zuban/specialtypes_none.toml new file mode 100644 index 000000000..698c02f17 --- /dev/null +++ b/conformance/results/zuban/specialtypes_none.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" +specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") +specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" +""" diff --git a/conformance/results/zuban/specialtypes_promotions.toml b/conformance/results/zuban/specialtypes_promotions.toml new file mode 100644 index 000000000..469985d2b --- /dev/null +++ b/conformance/results/zuban/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_promotions.py:13: error: "float" has no attribute "numerator" +""" diff --git a/conformance/results/zuban/specialtypes_type.toml b/conformance/results/zuban/specialtypes_type.toml new file mode 100644 index 000000000..01efce3ec --- /dev/null +++ b/conformance/results/zuban/specialtypes_type.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" +specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" +specialtypes_type.py:76: error: Invalid type comment or annotation +specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" +specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" +specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:146: error: "_SpecialForm" has no attribute "unknown" +""" diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml new file mode 100644 index 000000000..fe4bd5008 --- /dev/null +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -0,0 +1,37 @@ +conformant = "Pass" +notes = """ +Does not support tuple narrowing based on `len()` type guard (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 80, 81: Expected exactly one error (tag 'func5_2') +Line 80: Unexpected errors ['tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]"'] +Line 81: Unexpected errors ['tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]"'] +""" +output = """ +tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") +tuples_type_compat.py:29: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, Unpack[Tuple[int, ...]]]") +tuples_type_compat.py:32: error: Incompatible types in assignment (expression has type "tuple[int, Unpack[Tuple[int, ...]]]", variable has type "tuple[int]") +tuples_type_compat.py:33: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") +tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") +tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") +tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" +tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" +tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" +tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" +tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" +tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" +tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") +tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:169: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:170: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:176: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:181: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") +tuples_type_compat.py:184: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:188: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[Unpack[Tuple[str, ...]], str, str, str]") +""" diff --git a/conformance/results/zuban/tuples_type_form.toml b/conformance/results/zuban/tuples_type_form.toml new file mode 100644 index 000000000..7d1d7edab --- /dev/null +++ b/conformance/results/zuban/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_form.py:12: error: Incompatible types in assignment (expression has type "tuple[int, int]", variable has type "tuple[int]") +tuples_type_form.py:14: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[int, int]") +tuples_type_form.py:15: error: Incompatible types in assignment (expression has type "tuple[int, str]", variable has type "tuple[int, int]") +tuples_type_form.py:25: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[()]") +tuples_type_form.py:36: error: Incompatible types in assignment (expression has type "tuple[int, int, int, str]", variable has type "tuple[int, ...]") +tuples_type_form.py:40: error: Unexpected "..." +tuples_type_form.py:41: error: Unexpected "..." +tuples_type_form.py:42: error: Unexpected "..." +tuples_type_form.py:43: error: Unexpected "..." +tuples_type_form.py:44: error: Unpack is only valid in a variadic position +tuples_type_form.py:45: error: Unpack is only valid in a variadic position +""" diff --git a/conformance/results/zuban/tuples_unpacked.toml b/conformance/results/zuban/tuples_unpacked.toml new file mode 100644 index 000000000..e8422d81c --- /dev/null +++ b/conformance/results/zuban/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:41: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:61: error: More than one Unpack in a type is not allowed +""" diff --git a/conformance/results/zuban/typeddicts_alt_syntax.toml b/conformance/results/zuban/typeddicts_alt_syntax.toml new file mode 100644 index 000000000..16ef84dce --- /dev/null +++ b/conformance/results/zuban/typeddicts_alt_syntax.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +notes = """ +Does not support keyword-argument form of alternative syntax (deprecated in 3.11). +""" +errors_diff = """ +""" +output = """ +typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument +typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name +typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" +typeddicts_alt_syntax.py:35: error: Too many arguments for "TODO()" +typeddicts_alt_syntax.py:41: error: TypedDict() expects a dictionary literal as the second argument +""" diff --git a/conformance/results/zuban/typeddicts_class_syntax.toml b/conformance/results/zuban/typeddicts_class_syntax.toml new file mode 100644 index 000000000..8f550a254 --- /dev/null +++ b/conformance/results/zuban/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for TypedDict +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for TypedDict +""" diff --git a/conformance/results/zuban/typeddicts_final.toml b/conformance/results/zuban/typeddicts_final.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/typeddicts_final.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/typeddicts_inheritance.toml b/conformance/results/zuban/typeddicts_inheritance.toml new file mode 100644 index 000000000..a4ea1936f --- /dev/null +++ b/conformance/results/zuban/typeddicts_inheritance.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_inheritance.py:44: error: All bases of a new TypedDict must be TypedDict types +typeddicts_inheritance.py:55: error: Overwriting TypedDict field "x" while extending +typeddicts_inheritance.py:65: error: Overwriting TypedDict field "x" while merging +""" diff --git a/conformance/results/zuban/typeddicts_operations.toml b/conformance/results/zuban/typeddicts_operations.toml new file mode 100644 index 000000000..fbe20908f --- /dev/null +++ b/conformance/results/zuban/typeddicts_operations.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_operations.py:22: error: Value of "name" has incompatible type "int"; expected "str" +typeddicts_operations.py:23: error: Value of "year" has incompatible type "str"; expected "int" +typeddicts_operations.py:24: error: TypedDict "Movie" has no key "other" +typeddicts_operations.py:26: error: TypedDict "Movie" has no key "other" +typeddicts_operations.py:28: error: Missing key "year" for TypedDict "Movie" +typeddicts_operations.py:29: error: Incompatible types (expression has type "float", TypedDict item "year" has type "int") +typeddicts_operations.py:32: error: Extra key "other" for TypedDict "Movie" +typeddicts_operations.py:37: error: Expected TypedDict key to be string literal +typeddicts_operations.py:47: error: "Movie" has no attribute "clear" +typeddicts_operations.py:49: error: Key "name" of TypedDict "Movie" cannot be deleted +typeddicts_operations.py:62: error: "MovieOptional" has no attribute "clear" +""" diff --git a/conformance/results/zuban/typeddicts_readonly.toml b/conformance/results/zuban/typeddicts_readonly.toml new file mode 100644 index 000000000..3185cff8d --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated +typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated +typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated +typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated +typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated +typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated +""" diff --git a/conformance/results/zuban/typeddicts_readonly_consistency.toml b/conformance/results/zuban/typeddicts_readonly_consistency.toml new file mode 100644 index 000000000..4a317175c --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_consistency.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") +typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") +typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") +typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") +typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") +typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") +typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") +""" diff --git a/conformance/results/zuban/typeddicts_readonly_inheritance.toml b/conformance/results/zuban/typeddicts_readonly_inheritance.toml new file mode 100644 index 000000000..791935087 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -0,0 +1,34 @@ +conformant = "Partial" +notes = """ +Incorrectly rejects non-ReadOnly override of ReadOnly item. +Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. +Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending'] +Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending'] +Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending'] +Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending'] +Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending'] +""" +output = """ +typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending +typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated +typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending +typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending +typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending +typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" +typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending +typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" +typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") +typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" +typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending +typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending +typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending +typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging +""" diff --git a/conformance/results/zuban/typeddicts_readonly_kwargs.toml b/conformance/results/zuban/typeddicts_readonly_kwargs.toml new file mode 100644 index 000000000..4889dc9b3 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_kwargs.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated +""" diff --git a/conformance/results/zuban/typeddicts_readonly_update.toml b/conformance/results/zuban/typeddicts_readonly_update.toml new file mode 100644 index 000000000..54c32eb20 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_update.toml @@ -0,0 +1,10 @@ +conformant = "Partial" +notes = """ +Incorrectly allows update of ReadOnly item. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml new file mode 100644 index 000000000..1d81007d5 --- /dev/null +++ b/conformance/results/zuban/typeddicts_required.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition +typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition +typeddicts_required.py:62: error: "Required[]" type cannot be nested +typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested +""" diff --git a/conformance/results/zuban/typeddicts_type_consistency.toml b/conformance/results/zuban/typeddicts_type_consistency.toml new file mode 100644 index 000000000..7ad2d28a5 --- /dev/null +++ b/conformance/results/zuban/typeddicts_type_consistency.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_type_consistency.py:21: error: Incompatible types in assignment (expression has type "B1", variable has type "A1") +typeddicts_type_consistency.py:38: error: Incompatible types in assignment (expression has type "B2", variable has type "A2") +typeddicts_type_consistency.py:65: error: Incompatible types in assignment (expression has type "A3", variable has type "B3") +typeddicts_type_consistency.py:69: error: Extra key "y" for TypedDict "A3" +typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, int]") +typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") +typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") +typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") +typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") +typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") +typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") +""" diff --git a/conformance/results/zuban/typeddicts_usage.toml b/conformance/results/zuban/typeddicts_usage.toml new file mode 100644 index 000000000..d34748faf --- /dev/null +++ b/conformance/results/zuban/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_usage.py:23: error: TypedDict "Movie" has no key "director" +typeddicts_usage.py:24: error: Value of "year" has incompatible type "str"; expected "int" +typeddicts_usage.py:28: error: Extra key "title" for TypedDict "Movie" +typeddicts_usage.py:28: error: Missing key "name" for TypedDict "Movie" +typeddicts_usage.py:35: error: Cannot use isinstance() with TypedDict type +typeddicts_usage.py:40: error: Invalid type +""" diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml new file mode 100644 index 000000000..1958436d8 --- /dev/null +++ b/conformance/results/zuban/version.toml @@ -0,0 +1,2 @@ +version = "zuban 0.0.18" +test_duration = 1.89 From b33d340d3ef1604d669d998362343850e0c9faef Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 11 Aug 2025 22:15:19 +0200 Subject: [PATCH 4/5] Running main.py and using the correct zuban version --- .../results/mypy/overloads_definitions_stub.toml | 2 +- conformance/results/mypy/qualifiers_annotated.toml | 1 - conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/classes_classvar.toml | 1 - .../results/pyre/overloads_definitions_stub.toml | 4 ++-- conformance/results/pyre/typeddicts_alt_syntax.toml | 1 - conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 13 +++++++------ .../results/zuban/dataclasses_transform_func.toml | 12 ++++++------ conformance/results/zuban/version.toml | 4 ++-- 11 files changed, 21 insertions(+), 23 deletions(-) diff --git a/conformance/results/mypy/overloads_definitions_stub.toml b/conformance/results/mypy/overloads_definitions_stub.toml index 2fccd76a3..51a1aa393 100644 --- a/conformance/results/mypy/overloads_definitions_stub.toml +++ b/conformance/results/mypy/overloads_definitions_stub.toml @@ -4,7 +4,7 @@ Allows @override to appear in a stub file not on the first overload. """ conformance_automated = "Fail" errors_diff = """ -Lines 143, 147, 149: Expected error (tag 'override_impl') +Lines 143, 146, 147, 149: Expected error (tag 'override_impl') """ output = """ overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index b93e964ac..b26a6b4f5 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -38,5 +38,4 @@ Line 85: Expected 1 errors Line 93: Expected 1 errors Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]'] Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] -Line 119: Unexpected errors ['qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]', 'qualifiers_annotated.py:119: error: Invalid assignment target [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 55be4d997..731bf6fb8 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.17.1" -test_duration = 2.8 +test_duration = 2.96 diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 77c9e7265..1f3bb297f 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -33,6 +33,5 @@ Line 70: Expected 1 errors Line 73: Expected 1 errors Line 77: Expected 1 errors Line 78: Expected 1 errors -Line 66: Unexpected errors ['classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized.'] Line 74: Unexpected errors ['classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] """ diff --git a/conformance/results/pyre/overloads_definitions_stub.toml b/conformance/results/pyre/overloads_definitions_stub.toml index 4a9239556..7734a4421 100644 --- a/conformance/results/pyre/overloads_definitions_stub.toml +++ b/conformance/results/pyre/overloads_definitions_stub.toml @@ -4,8 +4,8 @@ Expects @final and @override to be present on all overloads, not just first. """ conformance_automated = "Fail" errors_diff = """ -Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') +Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') Line 63: Unexpected errors ['overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] diff --git a/conformance/results/pyre/typeddicts_alt_syntax.toml b/conformance/results/pyre/typeddicts_alt_syntax.toml index c172f19d5..04257f60c 100644 --- a/conformance/results/pyre/typeddicts_alt_syntax.toml +++ b/conformance/results/pyre/typeddicts_alt_syntax.toml @@ -13,6 +13,5 @@ errors_diff = """ Line 27: Expected 1 errors Line 31: Expected 1 errors Line 35: Expected 1 errors -Line 45: Expected 1 errors Line 43: Unexpected errors ['typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index bdbaef2d2..95cf3faa9 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 5.4 +test_duration = 5.93 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 1199839e0..2944d808b 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.403" -test_duration = 4.3 +test_duration = 3.15 diff --git a/conformance/results/results.html b/conformance/results/results.html index 2f766bb09..1f47d7146 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,15 +159,16 @@

Python Type System Conformance Test Results

- - + - + diff --git a/conformance/results/zuban/dataclasses_transform_func.toml b/conformance/results/zuban/dataclasses_transform_func.toml index 2c2a8e822..9bd8738f4 100644 --- a/conformance/results/zuban/dataclasses_transform_func.toml +++ b/conformance/results/zuban/dataclasses_transform_func.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") -dataclasses_transform_func.py:61: error: Unsupported left operand type for < ("Customer1") -dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" -dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" -dataclasses_transform_func.py:90: error: Non-frozen dataclass cannot inherit from a frozen dataclass -dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only +dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") +dataclasses_transform_func.py:60: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" +dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" +dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 1958436d8..120befcc1 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1,2 +1,2 @@ -version = "zuban 0.0.18" -test_duration = 1.89 +version = "zuban 0.0.19" +test_duration = 0.15 From 485975cb22ca0cfce9f6f82524d3fbcd59636782 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 12 Aug 2025 08:58:57 +0200 Subject: [PATCH 5/5] Implement feedback from pull request --- conformance/results/mypy/qualifiers_annotated.toml | 2 -- conformance/results/results.html | 2 +- conformance/results/zuban/generics_defaults.toml | 5 +++++ conformance/results/zuban/qualifiers_annotated.toml | 1 - conformance/src/type_checker.py | 5 ----- conformance/tests/qualifiers_annotated.py | 3 --- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index b26a6b4f5..c21e2043d 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -28,8 +28,6 @@ qualifiers_annotated.py:91: error: "" not callable [operat qualifiers_annotated.py:92: error: "" not callable [operator] qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] -qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc] -qualifiers_annotated.py:119: error: Invalid assignment target [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 1f47d7146..6203268b8 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -256,7 +256,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index 76fad1289..f54654743 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -1,4 +1,9 @@ conformant = "Partial" +notes = """ +Does not reject TypeVars with defaults after a TypeVarTuple +Type parameter defaults are not bound by attribute access +ParamSpec after TypeVarTuple is not always handled correctly +""" conformance_automated = "Fail" errors_diff = """ Line 141: Expected 1 errors diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 4fd1fd93b..822a7e8e0 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -24,5 +24,4 @@ qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type " qualifiers_annotated.py:91: error: "_SpecialForm" not callable qualifiers_annotated.py:92: error: "_SpecialForm" not callable qualifiers_annotated.py:93: error: "" not callable -qualifiers_annotated.py:119: error: Name "T" already defined on line 25 """ diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 55be2bece..3f02c9ee2 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -291,11 +291,6 @@ def install(self) -> bool: [sys.executable, "-m", "pip", "install", "zuban"], check=True, ) - - # Run "mypy --version" to ensure that it's installed and to work - # around timing issues caused by malware scanners on some systems. - self.get_version() - return True except CalledProcessError: print("Unable to install zuban") diff --git a/conformance/tests/qualifiers_annotated.py b/conformance/tests/qualifiers_annotated.py index a24814136..ebbab4ad2 100644 --- a/conformance/tests/qualifiers_annotated.py +++ b/conformance/tests/qualifiers_annotated.py @@ -115,7 +115,4 @@ class ClassC(TypedDict): TA1: TypeAlias = Annotated[int | str, ""] TA2 = Annotated[Literal[1, 2], ""] - -T = TypeVar("T") # E?: T is already defined - TA3 = Annotated[T, ""]
 
mypy 1.17.1
-
7.5sec
+
3.0sec
pyright 1.1.403
+
3.1sec
pyre 0.9.25
-
14.1sec
+
5.9sec
zuban 0.0.18
-
1.9sec
+
zuban 0.0.19
+
0.15sec
@@ -651,10 +652,10 @@

Python Type System Conformance Test Results

Partial

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

     constructors_callable
Partial

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

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

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

Struggles with some cases of self types

Partial

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

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

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

Pass
Partial

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

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

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

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

Incorrectly raises incompatibility type errors.

Partial

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

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

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

Partial

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

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

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

Struggles with some cases of self types

     constructors_consistency
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

Partial Pass
Unsupported

Does not support generic defaults.

Partial
Partial

Does not reject TypeVars with defaults after a TypeVarTuple

Type parameter defaults are not bound by attribute access

ParamSpec after TypeVarTuple is not always handled correctly

     generics_defaults_referential Partial