From 1006bedb7eded0c2d74ff3712341d2bff5d6912b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 15 Mar 2024 23:30:03 -0600 Subject: [PATCH] =?UTF-8?q?Added=20missing=20tests=20for=20"TypeVar=20with?= =?UTF-8?q?=20upper=20bounds"=20section=20of=20Generi=E2=80=A6=20(#1662)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added missing tests for "TypeVar with upper bounds" section of Generics chapter. --- .../results/mypy/aliases_explicit.toml | 22 ++++++++ .../results/mypy/aliases_implicit.toml | 37 ++++++++++++++ conformance/results/mypy/aliases_newtype.toml | 17 +++++++ .../results/mypy/aliases_recursive.toml | 11 ++++ .../results/mypy/aliases_type_statement.toml | 41 +++++++++++++++ .../results/mypy/aliases_typealiastype.toml | 51 +++++++++++++++++++ .../results/mypy/aliases_variance.toml | 4 ++ .../mypy/annotations_forward_refs.toml | 23 +++++++++ .../results/mypy/annotations_generators.toml | 9 ++++ .../results/mypy/annotations_methods.toml | 1 + .../results/mypy/annotations_typeexpr.toml | 19 +++++++ .../results/mypy/callables_annotation.toml | 13 +++++ .../results/mypy/callables_kwargs.toml | 20 ++++++++ .../results/mypy/callables_protocol.toml | 31 +++++++++++ .../results/mypy/classes_classvar.toml | 21 ++++++++ .../results/mypy/classes_override.toml | 6 +++ .../results/mypy/dataclasses_descriptors.toml | 2 + .../results/mypy/dataclasses_frozen.toml | 4 ++ .../results/mypy/dataclasses_inheritance.toml | 2 + .../results/mypy/dataclasses_kwonly.toml | 12 +++++ .../results/mypy/dataclasses_order.toml | 1 + .../results/mypy/dataclasses_postinit.toml | 8 +++ .../results/mypy/dataclasses_slots.toml | 3 ++ .../mypy/dataclasses_transform_class.toml | 6 +++ .../mypy/dataclasses_transform_field.toml | 4 ++ .../mypy/dataclasses_transform_func.toml | 6 +++ .../mypy/dataclasses_transform_meta.toml | 6 +++ .../results/mypy/dataclasses_usage.toml | 13 +++++ .../results/mypy/directives_assert_type.toml | 8 +++ conformance/results/mypy/directives_cast.toml | 13 +++++ .../mypy/directives_no_type_check.toml | 1 + .../results/mypy/directives_reveal_type.toml | 8 +++ .../results/mypy/directives_type_ignore.toml | 3 ++ .../mypy/directives_type_ignore_file2.toml | 1 + .../mypy/directives_version_platform.toml | 4 ++ .../results/mypy/generics_base_class.toml | 8 +++ conformance/results/mypy/generics_basic.toml | 14 +++++ .../results/mypy/generics_upper_bound.toml | 9 ++++ .../results/mypy/protocols_modules.toml | 10 ++++ .../mypy/qualifiers_final_decorator.toml | 15 ++++++ conformance/results/mypy/version.toml | 2 +- .../results/pyre/generics_base_class.toml | 14 ++--- .../results/pyre/generics_upper_bound.toml | 9 ++++ conformance/results/pyre/version.toml | 2 +- .../results/pyright/generics_base_class.toml | 10 ++-- .../results/pyright/generics_upper_bound.toml | 14 +++++ .../results/pytype/generics_base_class.toml | 7 ++- .../results/pytype/generics_upper_bound.toml | 12 +++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 2 +- conformance/tests/generics_base_class.py | 29 ++++++++++- conformance/tests/generics_upper_bound.py | 48 +++++++++++++++++ 52 files changed, 622 insertions(+), 16 deletions(-) create mode 100644 conformance/results/mypy/generics_upper_bound.toml create mode 100644 conformance/results/pyre/generics_upper_bound.toml create mode 100644 conformance/results/pyright/generics_upper_bound.toml create mode 100644 conformance/results/pytype/generics_upper_bound.toml create mode 100644 conformance/tests/generics_upper_bound.py diff --git a/conformance/results/mypy/aliases_explicit.toml b/conformance/results/mypy/aliases_explicit.toml index a82806b23..6ca1a371d 100644 --- a/conformance/results/mypy/aliases_explicit.toml +++ b/conformance/results/mypy/aliases_explicit.toml @@ -3,4 +3,26 @@ notes = """ Does not reject specialization of type alias that has already been implicitly specialized. """ output = """ +aliases_explicit.py:67: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] +aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] +aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] +aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] +aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type] +aliases_explicit.py:81: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:87: error: Variable "aliases_explicit.var1" is not valid as a type [valid-type] +aliases_explicit.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_explicit.py:88: error: Invalid type: try using Literal[True] instead? [valid-type] +aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? [valid-type] +aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:90: error: Function "list" could always be true in boolean context [truthy-function] +aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:101: error: "" not callable [operator] +aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] """ diff --git a/conformance/results/mypy/aliases_implicit.toml b/conformance/results/mypy/aliases_implicit.toml index 2146548eb..12d111996 100644 --- a/conformance/results/mypy/aliases_implicit.toml +++ b/conformance/results/mypy/aliases_implicit.toml @@ -1,3 +1,40 @@ conformant = "Pass" output = """ +aliases_implicit.py:76: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] +aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] +aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] +aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] +aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" [type-var] +aliases_implicit.py:100: error: Function "list" could always be true in boolean context [truthy-function] +aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type [valid-type] +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 [valid-type] +aliases_implicit.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:108: error: Variable "aliases_implicit.BadTypeAlias3" is not valid as a type [valid-type] +aliases_implicit.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:109: error: Variable "aliases_implicit.BadTypeAlias4" is not valid as a type [valid-type] +aliases_implicit.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:110: error: Variable "aliases_implicit.BadTypeAlias5" is not valid as a type [valid-type] +aliases_implicit.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:111: error: Variable "aliases_implicit.BadTypeAlias6" is not valid as a type [valid-type] +aliases_implicit.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:112: error: Variable "aliases_implicit.BadTypeAlias7" is not valid as a type [valid-type] +aliases_implicit.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:113: error: Variable "aliases_implicit.BadTypeAlias8" is not valid as a type [valid-type] +aliases_implicit.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:114: error: Variable "aliases_implicit.BadTypeAlias9" is not valid as a type [valid-type] +aliases_implicit.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:115: error: Variable "aliases_implicit.BadTypeAlias10" is not valid as a type [valid-type] +aliases_implicit.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:116: error: Variable "aliases_implicit.BadTypeAlias11" is not valid as a type [valid-type] +aliases_implicit.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:117: error: Variable "aliases_implicit.BadTypeAlias12" is not valid as a type [valid-type] +aliases_implicit.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is not valid as a type [valid-type] +aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type [valid-type] +aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:133: error: "" not callable [operator] +aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] """ diff --git a/conformance/results/mypy/aliases_newtype.toml b/conformance/results/mypy/aliases_newtype.toml index 2146548eb..7aa7d64bd 100644 --- a/conformance/results/mypy/aliases_newtype.toml +++ b/conformance/results/mypy/aliases_newtype.toml @@ -1,3 +1,20 @@ conformant = "Pass" output = """ +aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] +aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +aliases_newtype.py:20: error: Cannot use isinstance() with NewType type [misc] +aliases_newtype.py:23: error: Cannot subclass "NewType" [misc] +aliases_newtype.py:32: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] +aliases_newtype.py:38: error: "GoodNewType1" expects no type arguments, but 1 given [type-arg] +aliases_newtype.py:41: error: Cannot redefine "GoodNewType2" as a NewType [misc] +aliases_newtype.py:41: error: Name "GoodNewType2" already defined on line 36 [no-redef] +aliases_newtype.py:44: error: Argument 2 to NewType(...) must be subclassable (got "int | str") [valid-newtype] +aliases_newtype.py:47: error: Type variable "aliases_newtype.T" is unbound [valid-type] +aliases_newtype.py:47: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_newtype.py:47: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_newtype.py:49: error: NewType cannot be used with protocol classes [misc] +aliases_newtype.py:51: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") [valid-newtype] +aliases_newtype.py:58: error: Argument 2 to NewType(...) must be subclassable (got "TD1") [valid-newtype] +aliases_newtype.py:60: error: NewType(...) expects exactly two positional arguments [misc] +aliases_newtype.py:62: error: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype] """ diff --git a/conformance/results/mypy/aliases_recursive.toml b/conformance/results/mypy/aliases_recursive.toml index 2146548eb..6d8137a2c 100644 --- a/conformance/results/mypy/aliases_recursive.toml +++ b/conformance/results/mypy/aliases_recursive.toml @@ -1,3 +1,14 @@ conformant = "Pass" output = """ +aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "int | str | float | list[Json] | dict[str, Json] | None" [dict-item] +aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "int | str | float | list[Json] | dict[str, Json] | None" [list-item] +aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "RecursiveTuple") [assignment] +aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] +aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:55: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:67: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item] +aliases_recursive.py:73: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item] +aliases_recursive.py:76: error: Invalid recursive alias: a union item of itself [misc] +aliases_recursive.py:81: error: Invalid recursive alias: a union item of itself [misc] """ diff --git a/conformance/results/mypy/aliases_type_statement.toml b/conformance/results/mypy/aliases_type_statement.toml index adfbee927..3774e7bf1 100644 --- a/conformance/results/mypy/aliases_type_statement.toml +++ b/conformance/results/mypy/aliases_type_statement.toml @@ -3,10 +3,17 @@ notes = """ Does not support `type` statement. """ output = """ +aliases_type_statement.py: error: Cannot assign multiple types to name "BadTypeAlias14" without an explicit "Type[...]" annotation [misc] aliases_type_statement.py:8: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:9: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:9: error: Name "S3" is not defined [name-defined] +aliases_type_statement.py:9: error: Name "S1" is not defined [name-defined] +aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined] aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index] aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined] +aliases_type_statement.py:23: error: "type[int]" has no attribute "other_attrib" [attr-defined] aliases_type_statement.py:37: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:38: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:39: error: PEP 695 type aliases are not yet supported [valid-type] @@ -19,17 +26,51 @@ aliases_type_statement.py:45: error: PEP 695 type aliases are not yet supported aliases_type_statement.py:46: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:47: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:48: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:48: error: Function "list" could always be true in boolean context [truthy-function] aliases_type_statement.py:49: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:52: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:58: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:64: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:64: error: Name "K" is not defined [name-defined] aliases_type_statement.py:69: error: PEP 695 type aliases are not yet supported [valid-type] aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:72: error: Name "T" is not defined [name-defined] +aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] +aliases_type_statement.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] +aliases_type_statement.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] +aliases_type_statement.py:75: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:77: error: Name "P" is not defined [name-defined] +aliases_type_statement.py:77: error: Name "T" is not defined [name-defined] +aliases_type_statement.py:77: error: Name "S" is not defined [name-defined] +aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] +aliases_type_statement.py:77: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:79: error: Unexpected "..." [misc] +aliases_type_statement.py:79: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] +aliases_type_statement.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:80: error: Unexpected "..." [misc] +aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] +aliases_type_statement.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:81: error: Unexpected "..." [misc] +aliases_type_statement.py:81: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] +aliases_type_statement.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type] +aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] +aliases_type_statement.py:82: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases aliases_type_statement.py:84: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:84: error: Name "RecursiveTypeAlias3" is not defined [name-defined] aliases_type_statement.py:86: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:86: error: Name "T" is not defined [name-defined] +aliases_type_statement.py:86: error: Cannot determine type of "RecursiveTypeAlias4" [has-type] aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:88: error: Name "T" is not defined [name-defined] +aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type] +aliases_type_statement.py:88: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases aliases_type_statement.py:90: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] +aliases_type_statement.py:90: error: Name "RecursiveTypeAlias7" is used before definition [used-before-def] aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type] """ diff --git a/conformance/results/mypy/aliases_typealiastype.toml b/conformance/results/mypy/aliases_typealiastype.toml index 603980249..4ed5f7931 100644 --- a/conformance/results/mypy/aliases_typealiastype.toml +++ b/conformance/results/mypy/aliases_typealiastype.toml @@ -3,4 +3,55 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ +aliases_typealiastype.py:17: error: Type variable "aliases_typealiastype.T" is unbound [valid-type] +aliases_typealiastype.py:17: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_typealiastype.py:17: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_typealiastype.py:17: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.T" is unbound [valid-type] +aliases_typealiastype.py:18: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_typealiastype.py:18: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.S" is unbound [valid-type] +aliases_typealiastype.py:18: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +aliases_typealiastype.py:18: note: (Hint: Use "S" in function signature to bind "S" inside a function) +aliases_typealiastype.py:18: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc] +aliases_typealiastype.py:19: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:22: error: Type variable "aliases_typealiastype.S" is unbound [valid-type] +aliases_typealiastype.py:22: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +aliases_typealiastype.py:22: note: (Hint: Use "S" in function signature to bind "S" inside a function) +aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc] +aliases_typealiastype.py:22: error: TypeVarTuple "Ts" is unbound [valid-type] +aliases_typealiastype.py:23: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object, object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_typealiastype.py:35: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type] +aliases_typealiastype.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:36: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type] +aliases_typealiastype.py:36: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:37: error: Unexpected "..." [misc] +aliases_typealiastype.py:37: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type] +aliases_typealiastype.py:37: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:38: error: Unexpected "..." [misc] +aliases_typealiastype.py:38: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type] +aliases_typealiastype.py:38: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:39: error: Bracketed expression "[...]" is not valid as a type [valid-type] +aliases_typealiastype.py:39: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type] +aliases_typealiastype.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:39: error: Unpack is only valid in a variadic position [valid-type] +aliases_typealiastype.py:40: error: Unexpected "..." [misc] +aliases_typealiastype.py:40: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type] +aliases_typealiastype.py:40: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:44: error: Type variable "aliases_typealiastype.S" is unbound [valid-type] +aliases_typealiastype.py:44: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +aliases_typealiastype.py:44: note: (Hint: Use "S" in function signature to bind "S" inside a function) +aliases_typealiastype.py:44: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:46: error: Type variable "aliases_typealiastype.S" is unbound [valid-type] +aliases_typealiastype.py:46: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +aliases_typealiastype.py:46: note: (Hint: Use "S" in function signature to bind "S" inside a function) +aliases_typealiastype.py:48: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:50: error: Cannot determine type of "BadAlias4" [has-type] +aliases_typealiastype.py:52: error: Cannot determine type of "BadAlias5" [has-type] +aliases_typealiastype.py:52: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type] +aliases_typealiastype.py:54: error: Cannot determine type of "BadAlias7" [has-type] +aliases_typealiastype.py:54: error: Name "BadAlias7" is used before definition [used-before-def] +aliases_typealiastype.py:69: error: Function "list" could always be true in boolean context [truthy-function] """ diff --git a/conformance/results/mypy/aliases_variance.toml b/conformance/results/mypy/aliases_variance.toml index 2146548eb..f20fc53d6 100644 --- a/conformance/results/mypy/aliases_variance.toml +++ b/conformance/results/mypy/aliases_variance.toml @@ -1,3 +1,7 @@ conformant = "Pass" output = """ +aliases_variance.py:24: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:28: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:32: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:44: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] """ diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index e24aef03f..34a604c35 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -5,4 +5,27 @@ Does not report error for use of quoted type with "|" operator (runtime error). Incorrectly generates error for quoted type defined in class scope. """ output = """ +annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:42: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:43: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:47: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] +annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:51: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] +annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? +annotations_forward_refs.py:80: error: Name "ClassF" is not defined [name-defined] +annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type] """ diff --git a/conformance/results/mypy/annotations_generators.toml b/conformance/results/mypy/annotations_generators.toml index 1acdeacbf..fbeeb9cdf 100644 --- a/conformance/results/mypy/annotations_generators.toml +++ b/conformance/results/mypy/annotations_generators.toml @@ -3,4 +3,13 @@ notes = """ Does not report incompatible Generator type in `yield from` statement. """ output = """ +annotations_generators.py:51: error: Missing return statement [return] +annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") [return-value] +annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] +annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] +annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") [misc] +annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes [misc] +annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes [misc] +annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] +annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] """ diff --git a/conformance/results/mypy/annotations_methods.toml b/conformance/results/mypy/annotations_methods.toml index d93e17525..cbbdd307c 100644 --- a/conformance/results/mypy/annotations_methods.toml +++ b/conformance/results/mypy/annotations_methods.toml @@ -3,4 +3,5 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ +annotations_methods.py:42: error: Expression is of type "B", not "A" [assert-type] """ diff --git a/conformance/results/mypy/annotations_typeexpr.toml b/conformance/results/mypy/annotations_typeexpr.toml index 2146548eb..501db9cb4 100644 --- a/conformance/results/mypy/annotations_typeexpr.toml +++ b/conformance/results/mypy/annotations_typeexpr.toml @@ -1,3 +1,22 @@ conformant = "Pass" output = """ +annotations_typeexpr.py:88: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:88: note: Suggestion: use eval[...] instead of eval(...) +annotations_typeexpr.py:89: error: Bracketed expression "[...]" is not valid as a type [valid-type] +annotations_typeexpr.py:90: error: Syntax error in type annotation [syntax] +annotations_typeexpr.py:90: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_typeexpr.py:91: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:92: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:93: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:94: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:95: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:96: error: Variable "annotations_typeexpr.var1" is not valid as a type [valid-type] +annotations_typeexpr.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_typeexpr.py:97: error: Invalid type: try using Literal[True] instead? [valid-type] +annotations_typeexpr.py:98: error: Invalid type: try using Literal[1] instead? [valid-type] +annotations_typeexpr.py:99: error: Invalid type: try using Literal[-1] instead? [valid-type] +annotations_typeexpr.py:100: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:101: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:102: error: Module "types" is not valid as a type [valid-type] +annotations_typeexpr.py:102: note: Perhaps you meant to use a protocol matching the module structure? """ diff --git a/conformance/results/mypy/callables_annotation.toml b/conformance/results/mypy/callables_annotation.toml index 2146548eb..a333e0fab 100644 --- a/conformance/results/mypy/callables_annotation.toml +++ b/conformance/results/mypy/callables_annotation.toml @@ -1,3 +1,16 @@ conformant = "Pass" output = """ +callables_annotation.py:13: error: Too few arguments [call-arg] +callables_annotation.py:14: error: Argument 2 has incompatible type "int"; expected "str" [arg-type] +callables_annotation.py:15: error: Too many arguments [call-arg] +callables_annotation.py:16: error: Unexpected keyword argument "a" [call-arg] +callables_annotation.py:16: error: Unexpected keyword argument "b" [call-arg] +callables_annotation.py:22: error: Too many arguments [call-arg] +callables_annotation.py:39: error: Please use "Callable[[], ]" or "Callable" [misc] +callables_annotation.py:40: error: The first argument to Callable must be a list of types, parameter specification, or "..." [valid-type] +callables_annotation.py:40: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas +callables_annotation.py:41: error: Bracketed expression "[...]" is not valid as a type [valid-type] +callables_annotation.py:41: note: Did you mean "List[...]"? +callables_annotation.py:42: error: Please use "Callable[[], ]" or "Callable" [misc] +callables_annotation.py:43: error: Unexpected "..." [misc] """ diff --git a/conformance/results/mypy/callables_kwargs.toml b/conformance/results/mypy/callables_kwargs.toml index 2146548eb..2e22ca6fe 100644 --- a/conformance/results/mypy/callables_kwargs.toml +++ b/conformance/results/mypy/callables_kwargs.toml @@ -1,3 +1,23 @@ conformant = "Pass" output = """ +callables_kwargs.py:22: note: "func1" defined here +callables_kwargs.py:43: error: Missing named argument "v1" for "func1" [call-arg] +callables_kwargs.py:43: error: Missing named argument "v3" for "func1" [call-arg] +callables_kwargs.py:48: error: Unexpected keyword argument "v4" for "func1" [call-arg] +callables_kwargs.py:49: error: Too many positional arguments for "func1" [misc] +callables_kwargs.py:55: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type] +callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "int" [arg-type] +callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "str" [arg-type] +callables_kwargs.py:60: error: "func1" gets multiple values for keyword argument "v1" [misc] +callables_kwargs.py:61: error: "func2" gets multiple values for keyword argument "v3" [misc] +callables_kwargs.py:61: error: Argument 1 to "func2" has incompatible type "int"; expected "str" [arg-type] +callables_kwargs.py:62: error: "func2" gets multiple values for keyword argument "v1" [misc] +callables_kwargs.py:98: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol3") [assignment] +callables_kwargs.py:98: note: "TDProtocol3.__call__" has type "Callable[[NamedArg(int, 'v1'), NamedArg(int, 'v2'), NamedArg(str, 'v3')], None]" +callables_kwargs.py:99: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol4") [assignment] +callables_kwargs.py:99: note: "TDProtocol4.__call__" has type "Callable[[NamedArg(int, 'v1')], None]" +callables_kwargs.py:100: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol5") [assignment] +callables_kwargs.py:100: note: "TDProtocol5.__call__" has type "Callable[[Arg(int, 'v1'), Arg(str, 'v3')], None]" +callables_kwargs.py:109: error: Overlap between argument names and ** TypedDict items: "v1" [misc] +callables_kwargs.py:121: error: Unpack item in ** argument must be a TypedDict [misc] """ diff --git a/conformance/results/mypy/callables_protocol.toml b/conformance/results/mypy/callables_protocol.toml index 2146548eb..fdffbe3bf 100644 --- a/conformance/results/mypy/callables_protocol.toml +++ b/conformance/results/mypy/callables_protocol.toml @@ -1,3 +1,34 @@ conformant = "Pass" output = """ +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:35: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:36: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:37: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], Any]", variable has type "Proto2") [assignment] +callables_protocol.py:67: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], Any]", variable has type "Proto2") [assignment] +callables_protocol.py:68: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], Any]", variable has type "Proto2") [assignment] +callables_protocol.py:69: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], Any]", variable has type "Proto2") [assignment] +callables_protocol.py:70: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") [assignment] +callables_protocol.py:97: note: "function" is missing following "Proto4" protocol member: +callables_protocol.py:97: note: other_attribute +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") [assignment] +callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") [assignment] +callables_protocol.py:169: note: "Proto8.__call__" has type overloaded function +callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" [attr-defined] +callables_protocol.py:197: error: "Proto9[[int], str]" has no attribute "other_attribute2"; maybe "other_attribute"? [attr-defined] +callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") [assignment] +callables_protocol.py:238: note: "Proto11.__call__" has type "Callable[[int, Arg(str, 'y')], Any]" +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") [assignment] +callables_protocol.py:260: note: "Proto12.__call__" has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0'), NamedArg(Any, 'kwarg1')], None]" +callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") [assignment] +callables_protocol.py:284: note: "Proto13_Default.__call__" has type "Callable[[DefaultArg(str, 'path')], str]" +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") [assignment] +callables_protocol.py:311: note: "Proto14_Default.__call__" has type "Callable[[DefaultNamedArg(str, 'path')], str]" """ diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 6439874ec..ddb1a097d 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -7,4 +7,25 @@ Does not reject use of ClassVar in TypeAlias definition. Does not infer type of ClassVar from assignment if no type is provided. """ output = """ +classes_classvar.py:36: error: ClassVar[...] must have at most one type argument [valid-type] +classes_classvar.py:37: error: Invalid type: try using Literal[3] instead? [valid-type] +classes_classvar.py:38: error: Name "var" is not defined [name-defined] +classes_classvar.py:43: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:44: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:50: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] +classes_classvar.py:52: error: Name "Final" is not defined [name-defined] +classes_classvar.py:53: error: Invalid type: ClassVar nested inside other type [valid-type] +classes_classvar.py:59: error: Invalid type: ClassVar nested inside other type [valid-type] +classes_classvar.py:61: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:62: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:63: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:65: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:76: error: Expression is of type "Any", not "float" [assert-type] +classes_classvar.py:100: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:129: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:129: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:129: note: z +classes_classvar.py:129: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:129: note: Protocol member ProtoA.y expected class variable, got instance variable """ diff --git a/conformance/results/mypy/classes_override.toml b/conformance/results/mypy/classes_override.toml index 986040a95..ca0ea7847 100644 --- a/conformance/results/mypy/classes_override.toml +++ b/conformance/results/mypy/classes_override.toml @@ -3,4 +3,10 @@ notes = """ Does not handle case where parent class derives from Any. """ output = """ +classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] +classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name [misc] +classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:91: error: Method "property1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:103: error: Method "method1" is marked as an override, but no base method was found with this name [misc] """ diff --git a/conformance/results/mypy/dataclasses_descriptors.toml b/conformance/results/mypy/dataclasses_descriptors.toml index 1b899d91d..b3ba809c1 100644 --- a/conformance/results/mypy/dataclasses_descriptors.toml +++ b/conformance/results/mypy/dataclasses_descriptors.toml @@ -3,4 +3,6 @@ notes = """ Does not correctly evaluate type of descriptor access. """ output = """ +dataclasses_descriptors.py:66: error: Expression is of type "Desc2[int]", not "int" [assert-type] +dataclasses_descriptors.py:67: error: Expression is of type "Desc2[str]", not "str" [assert-type] """ diff --git a/conformance/results/mypy/dataclasses_frozen.toml b/conformance/results/mypy/dataclasses_frozen.toml index 2146548eb..a4d73884c 100644 --- a/conformance/results/mypy/dataclasses_frozen.toml +++ b/conformance/results/mypy/dataclasses_frozen.toml @@ -1,3 +1,7 @@ conformant = "Pass" output = """ +dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only [misc] +dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only [misc] +dataclasses_frozen.py:23: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_frozen.py:33: error: Cannot inherit frozen dataclass from a non-frozen one [misc] """ diff --git a/conformance/results/mypy/dataclasses_inheritance.toml b/conformance/results/mypy/dataclasses_inheritance.toml index 2146548eb..72c6b22f9 100644 --- a/conformance/results/mypy/dataclasses_inheritance.toml +++ b/conformance/results/mypy/dataclasses_inheritance.toml @@ -1,3 +1,5 @@ conformant = "Pass" output = """ +dataclasses_inheritance.py:60: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] +dataclasses_inheritance.py:64: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] """ diff --git a/conformance/results/mypy/dataclasses_kwonly.toml b/conformance/results/mypy/dataclasses_kwonly.toml index 728915e53..d693c57fe 100644 --- a/conformance/results/mypy/dataclasses_kwonly.toml +++ b/conformance/results/mypy/dataclasses_kwonly.toml @@ -3,4 +3,16 @@ notes = """ Incorrectly rejects kw_only field with default before positional field. """ output = """ +dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [misc] +dataclasses_kwonly.py:29: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_kwonly.py:32: error: Too many positional arguments for "DC2" [misc] +dataclasses_kwonly.py:32: error: Too few arguments for "DC2" [call-arg] +dataclasses_kwonly.py:32: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_kwonly.py:35: error: "DC2" gets multiple values for keyword argument "b" [misc] +dataclasses_kwonly.py:35: error: Too few arguments for "DC2" [call-arg] +dataclasses_kwonly.py:35: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [misc] +dataclasses_kwonly.py:38: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_kwonly.py:38: error: Argument 2 to "DC2" has incompatible type "int"; expected "str" [arg-type] +dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [misc] """ diff --git a/conformance/results/mypy/dataclasses_order.toml b/conformance/results/mypy/dataclasses_order.toml index 2146548eb..f42a06aab 100644 --- a/conformance/results/mypy/dataclasses_order.toml +++ b/conformance/results/mypy/dataclasses_order.toml @@ -1,3 +1,4 @@ conformant = "Pass" output = """ +dataclasses_order.py:50: error: Unsupported operand types for < ("DC1" and "DC2") [operator] """ diff --git a/conformance/results/mypy/dataclasses_postinit.toml b/conformance/results/mypy/dataclasses_postinit.toml index 2146548eb..a94485d91 100644 --- a/conformance/results/mypy/dataclasses_postinit.toml +++ b/conformance/results/mypy/dataclasses_postinit.toml @@ -1,3 +1,11 @@ conformant = "Pass" output = """ +dataclasses_postinit.py:19: error: Argument 3 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" [override] +dataclasses_postinit.py:28: error: "DC1" has no attribute "x" [attr-defined] +dataclasses_postinit.py:29: error: "DC1" has no attribute "y" [attr-defined] +dataclasses_postinit.py:36: error: Signature of "__post_init__" incompatible with supertype "dataclass" [override] +dataclasses_postinit.py:36: note: Superclass: +dataclasses_postinit.py:36: note: def __post_init__(self: DC2, x: int, y: str) -> None +dataclasses_postinit.py:36: note: Subclass: +dataclasses_postinit.py:36: note: def __post_init__(self: DC2, x: int) -> None """ diff --git a/conformance/results/mypy/dataclasses_slots.toml b/conformance/results/mypy/dataclasses_slots.toml index 31745db49..8c06b49e4 100644 --- a/conformance/results/mypy/dataclasses_slots.toml +++ b/conformance/results/mypy/dataclasses_slots.toml @@ -3,4 +3,7 @@ notes = """ Does not reject write to instance variable that is not defined in __slots__. """ output = """ +dataclasses_slots.py:12: error: "DC1" both defines "__slots__" and is used with "slots=True" [misc] +dataclasses_slots.py:67: error: "type[DC6]" has no attribute "__slots__" [attr-defined] +dataclasses_slots.py:70: error: "DC6" has no attribute "__slots__" [attr-defined] """ diff --git a/conformance/results/mypy/dataclasses_transform_class.toml b/conformance/results/mypy/dataclasses_transform_class.toml index 2146548eb..e3b63d2a1 100644 --- a/conformance/results/mypy/dataclasses_transform_class.toml +++ b/conformance/results/mypy/dataclasses_transform_class.toml @@ -1,3 +1,9 @@ conformant = "Pass" output = """ +dataclasses_transform_class.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_class.py:60: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_class.py:63: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_class.py:69: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_class.py:79: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_class.py:119: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/mypy/dataclasses_transform_field.toml b/conformance/results/mypy/dataclasses_transform_field.toml index 7718b9049..83d454d45 100644 --- a/conformance/results/mypy/dataclasses_transform_field.toml +++ b/conformance/results/mypy/dataclasses_transform_field.toml @@ -3,4 +3,8 @@ notes = """ Does not properly handle field constructor that has default value for `kw_only` or `init` parameter. """ output = """ +dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" [call-arg] +dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [misc] +dataclasses_transform_field.py:75: error: Missing named argument "name" for "CustomerModel2" [call-arg] +dataclasses_transform_field.py:77: error: Missing named argument "id" for "CustomerModel2" [call-arg] """ diff --git a/conformance/results/mypy/dataclasses_transform_func.toml b/conformance/results/mypy/dataclasses_transform_func.toml index 1b505123f..fdba05f46 100644 --- a/conformance/results/mypy/dataclasses_transform_func.toml +++ b/conformance/results/mypy/dataclasses_transform_func.toml @@ -4,4 +4,10 @@ Does not handle `kw_only=False` override when `kw_only_default=True`. Does not report error when `order=False` and comparison operators are used. """ output = """ +dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] +dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_func.py:90: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/mypy/dataclasses_transform_meta.toml b/conformance/results/mypy/dataclasses_transform_meta.toml index 2146548eb..ca6df8752 100644 --- a/conformance/results/mypy/dataclasses_transform_meta.toml +++ b/conformance/results/mypy/dataclasses_transform_meta.toml @@ -1,3 +1,9 @@ conformant = "Pass" output = """ +dataclasses_transform_meta.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_meta.py:60: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_meta.py:63: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_meta.py:70: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_meta.py:80: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_meta.py:100: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/mypy/dataclasses_usage.toml b/conformance/results/mypy/dataclasses_usage.toml index 2146548eb..da8d922a8 100644 --- a/conformance/results/mypy/dataclasses_usage.toml +++ b/conformance/results/mypy/dataclasses_usage.toml @@ -1,3 +1,16 @@ conformant = "Pass" output = """ +dataclasses_usage.py:36: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass [misc] +dataclasses_usage.py:51: error: Missing positional argument "unit_price" in call to "InventoryItem" [call-arg] +dataclasses_usage.py:52: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" [arg-type] +dataclasses_usage.py:53: error: Too many arguments for "InventoryItem" [call-arg] +dataclasses_usage.py:62: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:68: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:74: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:84: error: Too many arguments for "DC4" [call-arg] +dataclasses_usage.py:89: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] +dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg] +dataclasses_usage.py:205: error: Name "v1" already defined on line 25 [no-redef] """ diff --git a/conformance/results/mypy/directives_assert_type.toml b/conformance/results/mypy/directives_assert_type.toml index 2146548eb..ed6efb743 100644 --- a/conformance/results/mypy/directives_assert_type.toml +++ b/conformance/results/mypy/directives_assert_type.toml @@ -1,3 +1,11 @@ conformant = "Pass" output = """ +directives_assert_type.py:27: error: Expression is of type "int | str", not "int" [assert-type] +directives_assert_type.py:28: error: Expression is of type "Any", not "int" [assert-type] +directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" [assert-type] +directives_assert_type.py:31: error: "assert_type" expects 2 arguments [misc] +directives_assert_type.py:31: error: Too few arguments for "assert_type" [call-arg] +directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" [assert-type] +directives_assert_type.py:33: error: "assert_type" expects 2 arguments [misc] +directives_assert_type.py:33: error: Too many arguments for "assert_type" [call-arg] """ diff --git a/conformance/results/mypy/directives_cast.toml b/conformance/results/mypy/directives_cast.toml index 2146548eb..c0119f44c 100644 --- a/conformance/results/mypy/directives_cast.toml +++ b/conformance/results/mypy/directives_cast.toml @@ -1,3 +1,16 @@ conformant = "Pass" output = """ +directives_cast.py:15: error: "cast" expects 2 arguments [misc] +directives_cast.py:15: error: All overload variants of "cast" require at least one argument [call-overload] +directives_cast.py:15: note: Possible overload variants: +directives_cast.py:15: note: def [_T] cast(typ: type[_T], val: Any) -> _T +directives_cast.py:15: note: def cast(typ: str, val: Any) -> Any +directives_cast.py:15: note: def cast(typ: object, val: Any) -> Any +directives_cast.py:16: error: Invalid type: try using Literal[1] instead? [valid-type] +directives_cast.py:17: error: "cast" expects 2 arguments [misc] +directives_cast.py:17: error: No overload variant of "cast" matches argument types "Any", "str", "str" [call-overload] +directives_cast.py:17: note: Possible overload variants: +directives_cast.py:17: note: def [_T] cast(typ: type[_T], val: Any) -> _T +directives_cast.py:17: note: def cast(typ: str, val: Any) -> Any +directives_cast.py:17: note: def cast(typ: object, val: Any) -> Any """ diff --git a/conformance/results/mypy/directives_no_type_check.toml b/conformance/results/mypy/directives_no_type_check.toml index 93f9d9733..ca52f1382 100644 --- a/conformance/results/mypy/directives_no_type_check.toml +++ b/conformance/results/mypy/directives_no_type_check.toml @@ -4,4 +4,5 @@ Does not honor `@no_type_check` class decorator. Does not reject invalid call of `@no_type_check` function. """ output = """ +directives_no_type_check.py:16: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/mypy/directives_reveal_type.toml b/conformance/results/mypy/directives_reveal_type.toml index 2146548eb..6612496cc 100644 --- a/conformance/results/mypy/directives_reveal_type.toml +++ b/conformance/results/mypy/directives_reveal_type.toml @@ -1,3 +1,11 @@ conformant = "Pass" output = """ +directives_reveal_type.py:14: note: Revealed type is "Union[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: "reveal_type" expects 1 argument [misc] +directives_reveal_type.py:19: error: Too few arguments for "reveal_type" [call-arg] +directives_reveal_type.py:20: error: "reveal_type" expects 1 argument [misc] +directives_reveal_type.py:20: error: Too many arguments for "reveal_type" [call-arg] """ diff --git a/conformance/results/mypy/directives_type_ignore.toml b/conformance/results/mypy/directives_type_ignore.toml index 687f09d8c..0657633de 100644 --- a/conformance/results/mypy/directives_type_ignore.toml +++ b/conformance/results/mypy/directives_type_ignore.toml @@ -4,4 +4,7 @@ Does not honor "# type: ignore" comment if comment includes additional text. """ output = """ directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax] +directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_type_ignore.py:14: note: Error code "assignment" not covered by "type: ignore" comment """ diff --git a/conformance/results/mypy/directives_type_ignore_file2.toml b/conformance/results/mypy/directives_type_ignore_file2.toml index 2146548eb..b5962200b 100644 --- a/conformance/results/mypy/directives_type_ignore_file2.toml +++ b/conformance/results/mypy/directives_type_ignore_file2.toml @@ -1,3 +1,4 @@ conformant = "Pass" output = """ +directives_type_ignore_file2.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/mypy/directives_version_platform.toml b/conformance/results/mypy/directives_version_platform.toml index 18e4ac0e2..fbc4936dc 100644 --- a/conformance/results/mypy/directives_version_platform.toml +++ b/conformance/results/mypy/directives_version_platform.toml @@ -4,4 +4,8 @@ Does not understand three-element form of sys.version checks. Does not understand os.name checks. """ output = """ +directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/mypy/generics_base_class.toml b/conformance/results/mypy/generics_base_class.toml index 2146548eb..d2245c827 100644 --- a/conformance/results/mypy/generics_base_class.toml +++ b/conformance/results/mypy/generics_base_class.toml @@ -1,3 +1,11 @@ conformant = "Pass" output = """ +generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] +generics_base_class.py:29: error: Variable "typing.Generic" is not valid as a type [valid-type] +generics_base_class.py:29: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_base_class.py:30: error: Variable "typing.Generic" is not valid as a type [valid-type] +generics_base_class.py:30: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given [type-arg] +generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] +generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 2146548eb..0b16997d2 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -1,3 +1,17 @@ conformant = "Pass" output = """ +generics_basic.py:36: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] +generics_basic.py:37: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] +generics_basic.py:44: error: TypeVar cannot have only a single constraint [misc] +generics_basic.py:48: error: Type variable "generics_basic.T" is unbound [valid-type] +generics_basic.py:48: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_basic.py:48: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_basic.py:59: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] +generics_basic.py:107: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] +generics_basic.py:140: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] +generics_basic.py:141: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] +generics_basic.py:167: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:167: error: Type variable "generics_basic.T" is unbound [valid-type] +generics_basic.py:167: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_basic.py:167: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ diff --git a/conformance/results/mypy/generics_upper_bound.toml b/conformance/results/mypy/generics_upper_bound.toml new file mode 100644 index 000000000..237a3fffc --- /dev/null +++ b/conformance/results/mypy/generics_upper_bound.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +output = """ +generics_upper_bound.py:22: error: Type variable "generics_upper_bound.T" is unbound [valid-type] +generics_upper_bound.py:22: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_upper_bound.py:22: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_upper_bound.py:41: error: Expression is of type "Collection[int]", not "list[int] | set[int]" [assert-type] +generics_upper_bound.py:43: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] +generics_upper_bound.py:48: error: TypeVar cannot have both values and an upper bound [misc] +""" diff --git a/conformance/results/mypy/protocols_modules.toml b/conformance/results/mypy/protocols_modules.toml index 2146548eb..def330375 100644 --- a/conformance/results/mypy/protocols_modules.toml +++ b/conformance/results/mypy/protocols_modules.toml @@ -1,3 +1,13 @@ conformant = "Pass" output = """ +protocols_modules.py:26: error: Incompatible types in assignment (expression has type Module, variable has type "Options2") [assignment] +protocols_modules.py:26: note: Following member(s) of Module "_protocols_modules1" have conflicts: +protocols_modules.py:26: note: timeout: expected "str", got "int" +protocols_modules.py:48: error: Incompatible types in assignment (expression has type Module, variable has type "Reporter2") [assignment] +protocols_modules.py:48: note: Following member(s) of Module "_protocols_modules2" have conflicts: +protocols_modules.py:48: note: Expected: +protocols_modules.py:48: note: def on_error(x: int) -> int +protocols_modules.py:48: note: Got: +protocols_modules.py:48: note: def on_error(x: int) -> None +protocols_modules.py:49: error: Incompatible types in assignment (expression has type Module, variable has type "Reporter3") [assignment] """ diff --git a/conformance/results/mypy/qualifiers_final_decorator.toml b/conformance/results/mypy/qualifiers_final_decorator.toml index 2146548eb..114785bd1 100644 --- a/conformance/results/mypy/qualifiers_final_decorator.toml +++ b/conformance/results/mypy/qualifiers_final_decorator.toml @@ -1,3 +1,18 @@ conformant = "Pass" output = """ +qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" [misc] +qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") [misc] +qualifiers_final_decorator.py:84: error: @final should be applied only to overload implementation [misc] +qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") [misc] +qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") [misc] +qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" [override] +qualifiers_final_decorator.py:118: note: Superclass: +qualifiers_final_decorator.py:118: note: def method(self, v: int) -> None +qualifiers_final_decorator.py:118: note: Subclass: +qualifiers_final_decorator.py:118: note: def method(self) -> None +qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions [misc] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index c8d80a45d..15e6e85c0 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.9.0" -test_duration = 2.0 +test_duration = 1.4 diff --git a/conformance/results/pyre/generics_base_class.toml b/conformance/results/pyre/generics_base_class.toml index 377d26107..4e4b14643 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -1,10 +1,12 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -Doesn't allow using generic in assert_type expression. +Does not reject illegal use of Generic. +Does not allow using generic in assert_type expression. """ output = """ -generics_base_class.py:22:25 Incompatible parameter type [6]: In call `takes_dict_incorrect`, for 1st positional argument, expected `Dict[str, List[object]]` but got `SymbolTable`. -generics_base_class.py:34:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`. -generics_base_class.py:37:21 Invalid type parameters [24]: Generic type `LinkedList` expects 1 type parameter, received 2. -generics_base_class.py:46:17 Invalid type parameters [24]: Generic type `MyDict` expects 1 type parameter, received 2. +generics_base_class.py:26:25 Incompatible parameter type [6]: In call `takes_dict_incorrect`, for 1st positional argument, expected `Dict[str, List[object]]` but got `SymbolTable`. +generics_base_class.py:45:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`. +generics_base_class.py:49:21 Invalid type parameters [24]: Generic type `LinkedList` expects 1 type parameter, received 2. +generics_base_class.py:61:17 Invalid type parameters [24]: Generic type `MyDict` expects 1 type parameter, received 2. +generics_base_class.py:68:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. """ diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml new file mode 100644 index 000000000..f60af4eab --- /dev/null +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -0,0 +1,9 @@ +conformant = "Partial" +notes = """ +Does not reject use of upper bound with constrained TypeVar. +""" +output = """ +generics_upper_bound.py:22:0 Invalid type [31]: Expression `Variable[T_Bad1 (bound to typing.List[Variable[generics_upper_bound.T]])]` is not a valid type. Type variables cannot contain other type variables in their constraints. +generics_upper_bound.py:43:7 Incompatible parameter type [6]: In call `longer`, for 1st positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. +generics_upper_bound.py:43:10 Incompatible parameter type [6]: In call `longer`, for 2nd positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. +""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 4bddb48b7..ac8158f0e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.19" -test_duration = 4.2 +test_duration = 4.0 diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index e0195779e..15e6a9987 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -1,9 +1,13 @@ conformant = "Pass" output = """ -generics_base_class.py:22:26 - error: Argument of type "SymbolTable" cannot be assigned to parameter "x" of type "dict[str, list[object]]" in function "takes_dict_incorrect" +generics_base_class.py:26:26 - error: Argument of type "SymbolTable" cannot be assigned to parameter "x" of type "dict[str, list[object]]" in function "takes_dict_incorrect"   "SymbolTable" is incompatible with "dict[str, list[object]]"     Type parameter "_VT@dict" is invariant, but "list[Node]" is not the same as "list[object]"     Consider switching from "dict" to "Mapping" which is covariant in the value type (reportArgumentType) -generics_base_class.py:37:38 - error: Too many type arguments provided for "LinkedList"; expected 1 but received 2 (reportInvalidTypeArguments) -generics_base_class.py:46:30 - error: Too many type arguments provided for "MyDict"; expected 1 but received 2 (reportInvalidTypeArguments) +generics_base_class.py:29:14 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) +generics_base_class.py:30:8 - error: "Generic" requires at least one type argument +generics_base_class.py:30:8 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) +generics_base_class.py:49:38 - error: Too many type arguments provided for "LinkedList"; expected 1 but received 2 (reportInvalidTypeArguments) +generics_base_class.py:61:30 - error: Too many type arguments provided for "MyDict"; expected 1 but received 2 (reportInvalidTypeArguments) +generics_base_class.py:68:28 - error: Type arguments for "Generic" must be unique """ diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml new file mode 100644 index 000000000..6cd0ae334 --- /dev/null +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +output = """ +generics_upper_bound.py:22:34 - error: TypeVar bound type cannot be generic +generics_upper_bound.py:22:39 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_upper_bound.py:43:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" +  Type "Literal[3]" cannot be assigned to type "Sized" +    "Literal[3]" is incompatible with protocol "Sized" +      "__len__" is not present (reportArgumentType) +generics_upper_bound.py:43:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" +  Type "Literal[3]" cannot be assigned to type "Sized" +    "Literal[3]" is incompatible with protocol "Sized" +      "__len__" is not present (reportArgumentType) +generics_upper_bound.py:48:44 - error: TypeVar cannot be both bound and constrained +""" diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index fdc323aec..1eefa2fd6 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -1,8 +1,11 @@ conformant = "Partial" notes = """ False negative on passing SymbolTable to dict[str, list[object]]. +Does not reject illegal use of Generic. """ output = """ -File "generics_base_class.py", line 37, in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] -File "generics_base_class.py", line 46, in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] +File "generics_base_class.py", line 29, in : Invalid type annotation 'T' [invalid-annotation] +File "generics_base_class.py", line 49, in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] +File "generics_base_class.py", line 61, in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] +File "generics_base_class.py", line 68, in : Invalid type annotation 'Generic' [invalid-annotation] """ diff --git a/conformance/results/pytype/generics_upper_bound.toml b/conformance/results/pytype/generics_upper_bound.toml new file mode 100644 index 000000000..cdb83b699 --- /dev/null +++ b/conformance/results/pytype/generics_upper_bound.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +notes = """ +Does not properly support assert_type. +""" +output = """ +File "generics_upper_bound.py", line 22, in : Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] +File "generics_upper_bound.py", line 35, in : list [assert-type] +File "generics_upper_bound.py", line 36, in : set [assert-type] +File "generics_upper_bound.py", line 41, in : Union[list, set] [assert-type] +File "generics_upper_bound.py", line 43, in : Function longer was called with the wrong arguments [wrong-arg-types] +File "generics_upper_bound.py", line 48, in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index e4947cb3b..1f16ca7ce 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.03.11" -test_duration = 31.5 +test_duration = 40.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index 8578c544f..2bc90dab2 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -156,7 +156,7 @@

Python Type System Conformance Test Results

-
 
mypy 1.9.0
2.0sec
pyright 1.1.354
1.5sec
pyre 0.9.19
4.2sec
pytype 2024.03.11
31.5sec
Type annotations
     annotations_coroutinesPassPass
Partial

Does not evaluate correct type for async function.

Partial

Does not evaluate correct type for async function.

     annotations_forward_refs
Partial

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

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

Incorrectly generates error for quoted type defined in class scope.

Pass
Partial

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

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

Does not reject f-string in quoted type annotation.

Incorrectly generates error for quoted type defined in class scope.

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

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

Partial

Does not reject some illegal type expression forms when quoted.

Incorrectly generates error for quoted type defined in class scope.

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

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

     annotations_generators
Partial

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

Pass
Partial

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

Incorrectly evaluates type of call to async generator.

Partial

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

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

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

     annotations_methods
Pass*

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

Pass*

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

Pass*

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

Pass*

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

     annotations_typeexprPassPassPass
Partial

Does not reject call expressions in type annotation.

Does not reject call lambda expression in type annotation.

Does not reject list expression in type annotation.

Does not reject ternary expression in type annotation.

Does not reject f-string in type annotation.

Does not reject module in type annotation.

Special types in annotations
     specialtypes_anyPassPass
Partial

Does not treat missing type argument as Any in generic type.

Does not support Any as a base class.

Pass
     specialtypes_neverPassPass
Partial

Does not treat Never as compatible with all other types.

Unsupported

Does not understand NoReturn or Never.

     specialtypes_nonePassPass
Partial

Does not correctly handle type annotation type[None].

Partial

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

Does not detect type incompatibility between None and incompatible protocol.

     specialtypes_promotionsPassPass
Partial

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

Pass
     specialtypes_type
Partial

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

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

Pass
Partial

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

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

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

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

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

Partial

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

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

Generics
     generics_base_classPassPass
Pass*

Doesn't allow using generic in assert_type expression.

Partial

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

     generics_basicPassPass
Partial

False positives in examples using constrained type variables.

False negative in custom map example.

False positive using `iter`.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

False negative for generic metaclass.

     generics_defaultsUnsupportedPassUnsupportedUnsupported
     generics_defaults_referentialUnsupportedPassUnsupportedUnsupported
     generics_defaults_specializationUnsupportedPassUnsupportedUnsupported
     generics_paramspec_basic
Partial

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

Pass
Partial

Does not enforce name consistency for ParamSpec assigned to identifier.

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

Does not reject ParamSpec when used in various invalid locations.

Unsupported

Does not support ParamSpec.

     generics_paramspec_components
Partial

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

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

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

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

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

Pass
Partial

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

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

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

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

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

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

Unsupported

Does not support ParamSpec.

     generics_paramspec_semanticsPass
Pass*

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

Partial

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

Reports error for legitimate Callable type annotation that uses Concatenate.

Does not evaluate the correct type for call of Callable defined with Concatenate.

Unsupported

Does not support ParamSpec.

     generics_paramspec_specializationPassPass
Partial

Reports error for legitimate use of ParamSpec and Concatenate in function signature.

Reports error for legitimate specialization of generic class parameterized with ParamSpec.

Partial

Rejects valid specialization of ParamSpec using list expression.

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

Reports error for valid method call involving ParamSpec.

     generics_scoping
Partial

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

Pass
Partial

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

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

Pass
     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
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_attributesPassPass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_basic
Partial

Does not properly handle constructor call through `cls` parameter.

Pass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_protocolsPassPass
Partial

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

Partial

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

     generics_self_usagePassPass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_syntax_compatibility
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_declarations
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_scoping
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_type_erasure
Partial

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

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

Pass
Partial

Doesn't allow using Node[Any] in assert_type expression.

False negatives on instance attribute access on the type.

Unsupported
     generics_typevartuple_args
Partial

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_basic
Partial

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

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_callablePassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_concatPassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_overloadsPassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_specialization
Partial

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

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

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_unpack
Partial

Does not reject multiple unpack operators in a tuple.

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_variance
Partial

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

Pass
Partial

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

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

Unsupported

Does not support covariant or contravariant TypeVars.

     generics_variance_inference
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

Type qualifiers
     qualifiers_annotated
Partial

Does not allow ClassVar to be nested within Annotated.

Does not allow Final to be nested within Annotated.

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

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

Does not reject call of type alias defined with Annotated.

Pass
Partial

Does not reject Annotated with a single parameter.

Does not reject call of Annotated with no type arguments.

Partial

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

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

Does not reject call of Annotated.

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

     qualifiers_final_annotation
Partial

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

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

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

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

Pass
Partial

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

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

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

Partial

Does not report Final variable with missing initialization.

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

Does not reject modification of global variable declared Final.

Does not reject modification of local variable declared Final.

     qualifiers_final_decoratorPassPass
Partial

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

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

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

Partial

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

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

Class type compatibility
     classes_classvar
Partial

Internal error if TypeVarTuple is used in ClassVar.

Does not reject use of ParamSpec in ClassVar.

Rejects ClassVar nested in Annotated.

Does not reject use of ClassVar in TypeAlias definition.

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

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.

Partial

Does not reject use of TypeVar in ClassVar.

Does not reject use of ParamSpec in ClassVar.

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

Rejects initialization of ClassVar if no type argument is provided.

Does not reject use of ClassVar in parameter type annotation.

Does not reject use of ClassVar in local variable annotation.

Does not reject use of ClassVar in instance variable annotation.

Does not reject use of ClassVar in return type annotation.

Does not reject use of ClassVar in type alias definition.

Does not reject assignment of ClassVar through instance of class.

     classes_override
Partial

Does not handle case where parent class derives from Any.

Pass
Unsupported

Does not yet support the @override decorator.

Unsupported

Does not yet support the @override decorator.

Type aliases
     aliases_explicit
Partial

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

Pass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

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

Does not report invalid specialization of generic type aliases.

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

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

Partial

Incorrectly reports error for type alias defined with ParamSpec.

Does not report invalid specialization of generic type alias with bound TypeVar.

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

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

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

     aliases_implicitPassPass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

Does not report invalid specialization of generic type aliases.

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

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

Partial

Incorrectly reports error for type alias defined with ParamSpec.

Does not report invalid specialization of generic type alias with bound TypeVar.

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

Allows some illegal annotation forms to be interpreted as valid type aliases.

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

     aliases_newtypePassPass
Partial

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

Does not reject use of NewType in class definition statement.

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

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

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

Partial

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

Does not reject use of NewType in class definition statement.

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

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

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

     aliases_recursivePassPass
Partial

Does not properly handle some recursive type aliases.

Does not properly handle specialization of generic recursive type aliases.

Partial

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

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

Does not detect cyclical references in recursive type alias definition.

     aliases_type_statement
Unsupported

Does not support `type` statement.

Pass
Unsupported

Does not support `type` statement.

Unsupported

Does not support `type` statement.

     aliases_typealiastype
Unsupported

Support for TypeAliasType is not implemented.

Pass
Unsupported

Support for TypeAliasType is not implemented.

Unsupported

Support for TypeAliasType is not implemented.

     aliases_variancePassPassPass
Unsupported

Does not detect variance incompatibility.

Literals
     literals_interactions
Partial

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

Pass
Partial

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

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

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

Partial

Incorrectly rejects some legal Literal annotations.

Does not reject some illegal Literal annotations.

Does not use Literal to distinguish overloads.

Does not narrow based on `x is Literal` type guard pattern.

Does not narrow based on `x == Literal` type guard pattern.

     literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

PassPass
Unsupported

Does not understand `LiteralString` special form.

     literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass
Partial

Does not support type aliases in Literal type expression.

Does not support nested Literal type expression.

Does not reject unary + operator in Literal type expression.

Does not reject tuple in Literal type expression.

Does not reject "bare" Literal in type expression.

Unsupported

Does not understand `Literal` type annotation.

     literals_semanticsPassPass
Partial

Does not reject augmented operation that modifies literal value.

Unsupported

Does not understand `Literal` type annotation.

Protocols
     protocols_class_objectsPassPass
Partial

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

Incorrectly reports some class objects as incompatible with a protocol.

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

Partial

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

Incorrectly reports some class objects as incompatible with a protocol.

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

     protocols_definition
Partial

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

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

Pass
Partial

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

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

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

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

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

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

Partial

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

Does not report error when instance variable is set through "self" access in protocol class.

Does not report protocol mismatch when concrete class has attribute with covariant type and protocol attribute is mutable.

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

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

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

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

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

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

Does not detect protocol mismatch if concrete method is a classmethod.

Does not detect protocol mismatch if concrete method is a staticmethod.

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

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

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

     protocols_explicit
Pass*

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

Pass
Partial

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

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

Partial

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

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

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

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

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

     protocols_generic
Partial

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

Pass
Partial

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

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

Partial

Does not correctly enforce contravariance in protocol type compatibility tests.

Does not correctly enforce invariance in protocol type compatibility tests.

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

     protocols_mergingPassPass
Partial

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

Partial

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

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

     protocols_modulesPassPass
Unsupported

Does not perform protocol checks for modules.

Partial

Does not report incompatibilities for protocol methods.

     protocols_recursivePassPassPass
Partial

Incorrectly reports type error for some recursive protocols.

     protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass
Unsupported

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

Does not reject issubclass call for data protocol.

Does not report unsafe overlap for runtime_checkable protocol.

Unsupported

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

Does not reject issubclass call for data protocol.

Does not report unsafe overlap for runtime_checkable protocol.

     protocols_selfPassPassPass
Partial

Does not properly handle Self type within a protocol.

     protocols_subtypingPassPassPass
Partial

Does not reject attempt to instantiate protocol class.

Does not report some protocol type compatibility violations involving contravariance.

     protocols_variancePassPass
Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

Callables
     callables_annotationPassPass
Partial

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

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

Pass
     callables_kwargsPassPass
Unsupported

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

Unsupported

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

     callables_protocolPassPass
Partial

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

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

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

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

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

Unsupported

Does not properly handle type compatibility checks with callback protocols.

Overloads
     overloads_basicPassPass
Partial

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

Partial

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

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

Dataclasses
     dataclasses_descriptors
Partial

Does not correctly evaluate type of descriptor access.

Pass
Partial

Incorrectly generates error when calling constructor of dataclass with descriptor.

Unsupported

Does not understand descriptor objects in dataclass.

     dataclasses_frozenPassPass
Partial

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

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

Unsupported

Does not report assignment to field within frozen dataclass instance.

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

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

     dataclasses_hash
Partial

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

Pass
Partial

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

Partial

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

     dataclasses_inheritancePassPass
Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

     dataclasses_kwonly
Partial

Incorrectly rejects kw_only field with default before positional field.

PassPass
Partial

Incorrectly reports error when kw_only field has default value.

Incorrectly rejects kw_only field with default before positional field.

     dataclasses_orderPassPass
Partial

Does not report type incompatibility with comparison operator.

Partial

Does not report type incompatibility with comparison operator.

     dataclasses_postinitPassPass
Unsupported

Does not perform validation of `__post_init__` method.

Does not reject access of `InitVar` from object.

Partial

Does not validate `__post_init__` method.

Reports incorrect error for incompatible `__post_init__` method override.

     dataclasses_slots
Partial

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

Pass
Partial

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

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

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

Partial

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

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

Incorrectly reports error when accessing `__slots__` when `slots=True`.

     dataclasses_transform_classPassPass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     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.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_func
Partial

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

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

Pass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_metaPassPass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_usagePassPass
Partial

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

Incorrectly reports error with InitVar that has default value.

Pass
Typed dictionaries
     typeddicts_alt_syntax
Pass*

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

Pass
Partial

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

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

Partial

Does not reject use of variable as second argument to `TypedDict` call.

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

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

     typeddicts_class_syntaxPassPass
Partial

Does not reject methods within TypedDict class.

Does not report when metaclass is provided.

Does not report when other keyword argument is provided.

Does not support generic TypedDict class.

Partial

Does not reject methods within TypedDict class.

Does not report when metaclass is provided.

Does not report when other keyword argument is provided.

     typeddicts_finalPassPass
Partial

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

Pass
     typeddicts_inheritancePassPass
Partial

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

Pass
     typeddicts_operationsPassPassPass
Partial

Does not report type violation with TypedDict value assignment.

Does not report reference to unknown key in TypedDict.

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

Does not reject delete operation for required key in TypedDict.

     typeddicts_readonlyUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_consistencyUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_inheritanceUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_kwargsUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_updateUnsupportedPassUnsupportedUnsupported
     typeddicts_required
Partial

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

Pass
Partial

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

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

Does not support recursive TypedDict definitions.

Partial

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

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

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

     typeddicts_type_consistencyPassPass
Partial

Does not reject assignment of TypedDict with missing key.

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

Does not properly handle nested TypedDicts.

Partial

Does not report some type violations for TypedDict type compatibility.

Incorrectly reports type violation in cases where there is none.

Does not report type incompatibility between TypedDict and `dict[str, Any]`.

     typeddicts_usagePassPass
Partial

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

Does not reject use of TypedDict as TypeVar bound.

Partial

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

Does not reject use of TypedDict as TypeVar bound.

Tuples
     tuples_type_compat
Partial

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

Incorrectly narrows tuple based on sequence patterns.

Pass
Partial

Does not support some unpacked tuple forms.

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

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

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

Partial

Does not support unpacked tuple forms.

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

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

     tuples_type_formPassPass
Partial

Does not reject some invalid tuple forms involving ellipsis.

Pass
     tuples_unpacked
Partial

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

Pass
Partial

Rejects some legal tuple type forms involving unpack.

Does not reject some illegal tuple type forms involving unpack.

Unsupported

Does not support `typing.Unpack`.

Does not support unpacked tuples within a tuple type form.

Named tuples
     namedtuples_define_class
Partial

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

Pass
Partial

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

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

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

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

Does not reject attempt to use NamedTuple with multiple inheritance.

Partial

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

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

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

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

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

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

Does not reject attempt to use NamedTuple with multiple inheritance.

     namedtuples_define_functional
Pass*

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

Pass
Pass*

Does not reject duplicate field names in functional form.

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

Does not support defaults in functional form.

Pass*

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

Does not support defaults in functional form.

     namedtuples_type_compatPassPass
Partial

Rejects valid type compatibility between named tuple and tuple.

Pass
     namedtuples_usage
Partial

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

Pass
Partial

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

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

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

Incorrectly handles subclasses of named tuples that add more attributes.

Partial

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

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

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

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

Type narrowing
     narrowing_typeguardPassPass
Partial

Does not support `tuple` in `assert_type` call.

Does not reject TypeGuard method with too few parameters.

Partial

Does not reject TypeGuard method with too few parameters.

Type checker directives
     directives_assert_typePassPass
Unsupported

Does not understand "assert_type".

Pass
     directives_castPassPassPass
Partial

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

     directives_no_type_check
Partial

Does not honor `@no_type_check` class decorator.

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

Pass*

Does not honor `@no_type_check` class decorator.

Pass*

Does not honor @no_type_check decorator.

Pass*

Does not honor @no_type_check decorator.

     directives_reveal_typePassPass
Unsupported

Does not understand reveal_type call.

Partial

Does not reject call to reveal_type with zero arguments.

Does not reject call to reveal_type with too many arguments.

     directives_type_checkingPassPassPassPass
     directives_type_ignore
Partial

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

PassPass
Partial

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

     directives_type_ignore_file1PassPass
Unsupported

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

Pass
     directives_type_ignore_file2PassPassPass
Partial

Does not ignore `# type: ignore` if it occurs after docstrings in the file.

     directives_version_platform
Pass*

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

Does not understand os.name checks.

Pass
Partial

Does not support sys.platform checks.

Does not support os.name checks.

Pass*

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

Does not understand os.name checks.

Historical and deprecated features
     historical_positional
Partial

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

Treats keyword-only parameter as positional-only.

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

Pass
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.

Partial

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

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

+
 
mypy 1.9.0
1.4sec
pyright 1.1.354
1.5sec
pyre 0.9.19
4.0sec
pytype 2024.03.11
40.0sec
Type annotations
     annotations_coroutinesPassPass
Partial

Does not evaluate correct type for async function.

Partial

Does not evaluate correct type for async function.

     annotations_forward_refs
Partial

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

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

Incorrectly generates error for quoted type defined in class scope.

Pass
Partial

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

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

Does not reject f-string in quoted type annotation.

Incorrectly generates error for quoted type defined in class scope.

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

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

Partial

Does not reject some illegal type expression forms when quoted.

Incorrectly generates error for quoted type defined in class scope.

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

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

     annotations_generators
Partial

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

Pass
Partial

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

Incorrectly evaluates type of call to async generator.

Partial

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

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

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

     annotations_methods
Pass*

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

Pass*

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

Pass*

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

Pass*

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

     annotations_typeexprPassPassPass
Partial

Does not reject call expressions in type annotation.

Does not reject call lambda expression in type annotation.

Does not reject list expression in type annotation.

Does not reject ternary expression in type annotation.

Does not reject f-string in type annotation.

Does not reject module in type annotation.

Special types in annotations
     specialtypes_anyPassPass
Partial

Does not treat missing type argument as Any in generic type.

Does not support Any as a base class.

Pass
     specialtypes_neverPassPass
Partial

Does not treat Never as compatible with all other types.

Unsupported

Does not understand NoReturn or Never.

     specialtypes_nonePassPass
Partial

Does not correctly handle type annotation type[None].

Partial

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

Does not detect type incompatibility between None and incompatible protocol.

     specialtypes_promotionsPassPass
Partial

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

Pass
     specialtypes_type
Partial

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

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

Pass
Partial

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

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

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

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

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

Partial

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

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

Generics
     generics_base_classPassPass
Partial

Does not reject illegal use of Generic.

Does not allow using generic in assert_type expression.

Partial

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

Does not reject illegal use of Generic.

     generics_basicPassPass
Partial

False positives in examples using constrained type variables.

False negative in custom map example.

False positive using `iter`.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

False negative for generic metaclass.

     generics_defaults_referentialUnsupportedPassUnsupportedUnsupported
     generics_defaults_specializationUnsupportedPassUnsupportedUnsupported
     generics_paramspec_basic
Partial

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

Pass
Partial

Does not enforce name consistency for ParamSpec assigned to identifier.

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

Does not reject ParamSpec when used in various invalid locations.

Unsupported

Does not support ParamSpec.

     generics_paramspec_components
Partial

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

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

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

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

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

Pass
Partial

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

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

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

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

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

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

Unsupported

Does not support ParamSpec.

     generics_paramspec_semanticsPass
Pass*

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

Partial

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

Reports error for legitimate Callable type annotation that uses Concatenate.

Does not evaluate the correct type for call of Callable defined with Concatenate.

Unsupported

Does not support ParamSpec.

     generics_paramspec_specializationPassPass
Partial

Reports error for legitimate use of ParamSpec and Concatenate in function signature.

Reports error for legitimate specialization of generic class parameterized with ParamSpec.

Partial

Rejects valid specialization of ParamSpec using list expression.

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

Reports error for valid method call involving ParamSpec.

     generics_scoping
Partial

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

Pass
Partial

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

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

Pass
     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
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_attributesPassPass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_basic
Partial

Does not properly handle constructor call through `cls` parameter.

Pass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_self_protocolsPassPass
Partial

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

Partial

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

     generics_self_usagePassPass
Unsupported

Does not understand `Self` type.

Unsupported

Does not understand `Self` type.

     generics_syntax_compatibility
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_declarations
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_scoping
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

     generics_type_erasure
Partial

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

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

Pass
Partial

Doesn't allow using Node[Any] in assert_type expression.

False negatives on instance attribute access on the type.

Unsupported
     generics_typevartuple_args
Partial

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_basic
Partial

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

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_callablePassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_concatPassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_overloadsPassPass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_specialization
Partial

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

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

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

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_unpack
Partial

Does not reject multiple unpack operators in a tuple.

Pass
Unsupported

Does not support TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_upper_boundPassPass
Partial

Does not reject use of upper bound with constrained TypeVar.

Pass*

Does not properly support assert_type.

     generics_variance
Partial

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

Pass
Partial

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

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

Unsupported

Does not support covariant or contravariant TypeVars.

     generics_variance_inference
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

Type qualifiers
     qualifiers_annotated
Partial

Does not allow ClassVar to be nested within Annotated.

Does not allow Final to be nested within Annotated.

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

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

Does not reject call of type alias defined with Annotated.

Pass
Partial

Does not reject Annotated with a single parameter.

Does not reject call of Annotated with no type arguments.

Partial

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

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

Does not reject call of Annotated.

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

     qualifiers_final_annotation
Partial

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

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

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

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

Pass
Partial

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

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

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

Partial

Does not report Final variable with missing initialization.

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

Does not reject modification of global variable declared Final.

Does not reject modification of local variable declared Final.

     qualifiers_final_decoratorPassPass
Partial

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

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

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

Partial

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

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

Class type compatibility
     classes_classvar
Partial

Internal error if TypeVarTuple is used in ClassVar.

Does not reject use of ParamSpec in ClassVar.

Rejects ClassVar nested in Annotated.

Does not reject use of ClassVar in TypeAlias definition.

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

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.

Partial

Does not reject use of TypeVar in ClassVar.

Does not reject use of ParamSpec in ClassVar.

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

Rejects initialization of ClassVar if no type argument is provided.

Does not reject use of ClassVar in parameter type annotation.

Does not reject use of ClassVar in local variable annotation.

Does not reject use of ClassVar in instance variable annotation.

Does not reject use of ClassVar in return type annotation.

Does not reject use of ClassVar in type alias definition.

Does not reject assignment of ClassVar through instance of class.

     classes_override
Partial

Does not handle case where parent class derives from Any.

Pass
Unsupported

Does not yet support the @override decorator.

Unsupported

Does not yet support the @override decorator.

Type aliases
     aliases_explicit
Partial

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

Pass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

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

Does not report invalid specialization of generic type aliases.

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

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

Partial

Incorrectly reports error for type alias defined with ParamSpec.

Does not report invalid specialization of generic type alias with bound TypeVar.

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

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

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

     aliases_implicitPassPass
Partial

Incorrectly reports error for type alias defined with ParamSpec.

Incorrectly rejects some valid type aliases when used in annotations.

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

Does not report invalid specialization of generic type aliases.

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

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

Partial

Incorrectly reports error for type alias defined with ParamSpec.

Does not report invalid specialization of generic type alias with bound TypeVar.

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

Allows some illegal annotation forms to be interpreted as valid type aliases.

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

     aliases_newtypePassPass
Partial

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

Does not reject use of NewType in class definition statement.

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

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

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

Partial

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

Does not reject use of NewType in class definition statement.

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

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

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

     aliases_recursivePassPass
Partial

Does not properly handle some recursive type aliases.

Does not properly handle specialization of generic recursive type aliases.

Partial

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

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

Does not detect cyclical references in recursive type alias definition.

     aliases_type_statement
Unsupported

Does not support `type` statement.

Pass
Unsupported

Does not support `type` statement.

Unsupported

Does not support `type` statement.

     aliases_typealiastype
Unsupported

Support for TypeAliasType is not implemented.

Pass
Unsupported

Support for TypeAliasType is not implemented.

Unsupported

Support for TypeAliasType is not implemented.

     aliases_variancePassPassPass
Unsupported

Does not detect variance incompatibility.

Literals
     literals_interactions
Partial

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

Pass
Partial

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

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

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

Partial

Incorrectly rejects some legal Literal annotations.

Does not reject some illegal Literal annotations.

Does not use Literal to distinguish overloads.

Does not narrow based on `x is Literal` type guard pattern.

Does not narrow based on `x == Literal` type guard pattern.

     literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

PassPass
Unsupported

Does not understand `LiteralString` special form.

     literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass
Partial

Does not support type aliases in Literal type expression.

Does not support nested Literal type expression.

Does not reject unary + operator in Literal type expression.

Does not reject tuple in Literal type expression.

Does not reject "bare" Literal in type expression.

Unsupported

Does not understand `Literal` type annotation.

     literals_semanticsPassPass
Partial

Does not reject augmented operation that modifies literal value.

Unsupported

Does not understand `Literal` type annotation.

Protocols
     protocols_class_objectsPassPass
Partial

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

Incorrectly reports some class objects as incompatible with a protocol.

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

Partial

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

Incorrectly reports some class objects as incompatible with a protocol.

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

     protocols_definition
Partial

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

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

Pass
Partial

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

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

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

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

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

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

Partial

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

Does not report error when instance variable is set through "self" access in protocol class.

Does not report protocol mismatch when concrete class has attribute with covariant type and protocol attribute is mutable.

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

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

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

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

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

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

Does not detect protocol mismatch if concrete method is a classmethod.

Does not detect protocol mismatch if concrete method is a staticmethod.

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

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

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

     protocols_explicit
Pass*

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

Pass
Partial

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

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

Partial

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

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

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

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

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

     protocols_generic
Partial

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

Pass
Partial

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

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

Partial

Does not correctly enforce contravariance in protocol type compatibility tests.

Does not correctly enforce invariance in protocol type compatibility tests.

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

     protocols_mergingPassPass
Partial

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

Partial

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

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

     protocols_modulesPassPass
Unsupported

Does not perform protocol checks for modules.

Partial

Does not report incompatibilities for protocol methods.

     protocols_recursivePassPassPass
Partial

Incorrectly reports type error for some recursive protocols.

     protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass
Unsupported

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

Does not reject issubclass call for data protocol.

Does not report unsafe overlap for runtime_checkable protocol.

Unsupported

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

Does not reject issubclass call for data protocol.

Does not report unsafe overlap for runtime_checkable protocol.

     protocols_selfPassPassPass
Partial

Does not properly handle Self type within a protocol.

     protocols_subtypingPassPassPass
Partial

Does not reject attempt to instantiate protocol class.

Does not report some protocol type compatibility violations involving contravariance.

     protocols_variancePassPass
Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

Callables
     callables_annotationPassPass
Partial

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

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

Pass
     callables_kwargsPassPass
Unsupported

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

Unsupported

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

     callables_protocolPassPass
Partial

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

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

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

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

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

Unsupported

Does not properly handle type compatibility checks with callback protocols.

Overloads
     overloads_basicPassPass
Partial

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

Partial

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

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

Dataclasses
     dataclasses_descriptors
Partial

Does not correctly evaluate type of descriptor access.

Pass
Partial

Incorrectly generates error when calling constructor of dataclass with descriptor.

Unsupported

Does not understand descriptor objects in dataclass.

     dataclasses_frozenPassPass
Partial

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

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

Unsupported

Does not report assignment to field within frozen dataclass instance.

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

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

     dataclasses_hash
Partial

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

Pass
Partial

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

Partial

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

     dataclasses_inheritancePassPass
Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

     dataclasses_kwonly
Partial

Incorrectly rejects kw_only field with default before positional field.

PassPass
Partial

Incorrectly reports error when kw_only field has default value.

Incorrectly rejects kw_only field with default before positional field.

     dataclasses_orderPassPass
Partial

Does not report type incompatibility with comparison operator.

Partial

Does not report type incompatibility with comparison operator.

     dataclasses_postinitPassPass
Unsupported

Does not perform validation of `__post_init__` method.

Does not reject access of `InitVar` from object.

Partial

Does not validate `__post_init__` method.

Reports incorrect error for incompatible `__post_init__` method override.

     dataclasses_slots
Partial

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

Pass
Partial

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

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

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

Partial

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

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

Incorrectly reports error when accessing `__slots__` when `slots=True`.

     dataclasses_transform_classPassPass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     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.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_func
Partial

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

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

Pass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_metaPassPass
Unsupported

Does not understand @dataclass_transform.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_usagePassPass
Partial

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

Incorrectly reports error with InitVar that has default value.

Pass
Typed dictionaries
     typeddicts_alt_syntax
Pass*

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

Pass
Partial

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

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

Partial

Does not reject use of variable as second argument to `TypedDict` call.

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

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

     typeddicts_class_syntaxPassPass
Partial

Does not reject methods within TypedDict class.

Does not report when metaclass is provided.

Does not report when other keyword argument is provided.

Does not support generic TypedDict class.

Partial

Does not reject methods within TypedDict class.

Does not report when metaclass is provided.

Does not report when other keyword argument is provided.

     typeddicts_finalPassPass
Partial

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

Pass
     typeddicts_inheritancePassPass
Partial

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

Pass
     typeddicts_operationsPassPassPass
Partial

Does not report type violation with TypedDict value assignment.

Does not report reference to unknown key in TypedDict.

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

Does not reject delete operation for required key in TypedDict.

     typeddicts_readonlyUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_consistencyUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_inheritanceUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_kwargsUnsupportedPassUnsupportedUnsupported
     typeddicts_readonly_updateUnsupportedPassUnsupportedUnsupported
     typeddicts_required
Partial

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

Pass
Partial

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

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

Does not support recursive TypedDict definitions.

Partial

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

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

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

     typeddicts_type_consistencyPassPass
Partial

Does not reject assignment of TypedDict with missing key.

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

Does not properly handle nested TypedDicts.

Partial

Does not report some type violations for TypedDict type compatibility.

Incorrectly reports type violation in cases where there is none.

Does not report type incompatibility between TypedDict and `dict[str, Any]`.

     typeddicts_usagePassPass
Partial

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

Does not reject use of TypedDict as TypeVar bound.

Partial

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

Does not reject use of TypedDict as TypeVar bound.

Tuples
     tuples_type_compat
Partial

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

Incorrectly narrows tuple based on sequence patterns.

Pass
Partial

Does not support some unpacked tuple forms.

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

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

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

Partial

Does not support unpacked tuple forms.

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

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

     tuples_type_formPassPass
Partial

Does not reject some invalid tuple forms involving ellipsis.

Pass
     tuples_unpacked
Partial

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

Pass
Partial

Rejects some legal tuple type forms involving unpack.

Does not reject some illegal tuple type forms involving unpack.

Unsupported

Does not support `typing.Unpack`.

Does not support unpacked tuples within a tuple type form.

Named tuples
     namedtuples_define_class
Partial

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

Pass
Partial

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

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

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

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

Does not reject attempt to use NamedTuple with multiple inheritance.

Partial

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

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

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

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

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

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

Does not reject attempt to use NamedTuple with multiple inheritance.

     namedtuples_define_functional
Pass*

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

Pass
Pass*

Does not reject duplicate field names in functional form.

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

Does not support defaults in functional form.

Pass*

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

Does not support defaults in functional form.

     namedtuples_type_compatPassPass
Partial

Rejects valid type compatibility between named tuple and tuple.

Pass
     namedtuples_usage
Partial

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

Pass
Partial

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

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

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

Incorrectly handles subclasses of named tuples that add more attributes.

Partial

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

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

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

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

Type narrowing
     narrowing_typeguardPassPass
Partial

Does not support `tuple` in `assert_type` call.

Does not reject TypeGuard method with too few parameters.

Partial

Does not reject TypeGuard method with too few parameters.

Type checker directives
     directives_assert_typePassPass
Unsupported

Does not understand "assert_type".

Pass
     directives_castPassPassPass
Partial

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

     directives_no_type_check
Partial

Does not honor `@no_type_check` class decorator.

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

Pass*

Does not honor `@no_type_check` class decorator.

Pass*

Does not honor @no_type_check decorator.

Pass*

Does not honor @no_type_check decorator.

     directives_reveal_typePassPass
Unsupported

Does not understand reveal_type call.

Partial

Does not reject call to reveal_type with zero arguments.

Does not reject call to reveal_type with too many arguments.

     directives_type_checkingPassPassPassPass
     directives_type_ignore
Partial

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

PassPass
Partial

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

     directives_type_ignore_file1PassPass
Unsupported

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

Pass
     directives_type_ignore_file2PassPassPass
Partial

Does not ignore `# type: ignore` if it occurs after docstrings in the file.

     directives_version_platform
Pass*

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

Does not understand os.name checks.

Pass
Partial

Does not support sys.platform checks.

Does not support os.name checks.

Pass*

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

Does not understand os.name checks.

Historical and deprecated features
     historical_positional
Partial

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

Treats keyword-only parameter as positional-only.

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

Pass
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.

Partial

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

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