mypy 1.18.2
|
pyright 1.1.407
|
zuban 0.2.3
|
pyrefly 0.42.2
|
|
|---|---|---|---|---|
| Type annotations | ||||
| annotations_coroutines | Pass | Pass | Pass | Pass |
| annotations_forward_refs | Partial Does not report error for a forward reference that is not enclosed in quotes. Does not report error for use of quoted type with "|" operator (runtime error). Incorrectly generates error for quoted type defined in class scope. |
Pass | Partial Does not report error for a forward reference that is not enclosed in quotes. Incorrectly generates error for quoted type defined in class scope. Does not ignore newlines in multi-line unions |
Partial Types in quotes incorrectly refer to shadowing class member. Does not reject some type forms that require quotes. |
| annotations_generators | Partial Does not report incompatible Generator type in `yield from` statement. |
Pass | Pass | Partial Does not detect that invalid yield is unreachable |
| annotations_methods | Pass* Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. |
Pass* Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. |
Pass | Pass |
| annotations_typeexpr | Pass | Pass | Pass | Pass |
| Special types in annotations | ||||
| specialtypes_any | Pass | Pass | Pass | Pass |
| specialtypes_never | Pass | Pass | Pass | Partial Does not detect invalid return is unreachable |
| specialtypes_none | Pass | Pass | Pass | Pass |
| specialtypes_promotions | Pass | Pass | Pass | Pass |
| specialtypes_type | Partial Does not treat `type` same as `type[Any]` for assert_type. Does not allow access to unknown attributes from object of type `type[Any]`. |
Pass | Pass | Partial Does not implement all typing rules for type/type[] |
| Generics | ||||
| generics_base_class | Partial Does not detect inconsistent type variable ordering. |
Pass | Partial Does not detect inconsistent type variable ordering in multi-inheritance. |
Partial Does not reject inconsistent ordering of type variables in different base classes. |
| generics_basic | Pass | Pass | Pass | Partial Incorrect rejects + between two AnyStr Constrained type var resolves to subtype instead of explcitly listed constraint |
| generics_defaults | Partial | Pass | Partial Does not reject TypeVars with defaults after a TypeVarTuple Type parameter defaults are not bound by attribute access ParamSpec after TypeVarTuple is not always handled correctly |
Partial Defaults are not bound by attribute access |
| generics_defaults_referential | Partial | Pass | Pass | Unsupported |
| generics_defaults_specialization | Partial | Pass | Pass | Pass |
| generics_paramspec_basic | Pass | Pass | Pass | Pass |
| generics_paramspec_components | Pass | Pass | Pass | Partial Does not reject usage of args/kwargs for out-of-scope ParamSpec |
| generics_paramspec_semantics | Pass | Pass* Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed). |
Pass | Pass |
| generics_paramspec_specialization | Pass | Pass | Pass | Pass |
| generics_scoping | Pass | Pass | Partial False negative on generic class nested within generic class with same type variable. |
Partial Does not implement several scoping checks/restrictions for generics |
| generics_self_advanced | Partial Does not infer the type of an unannotated `self` parameter to be type `Self`. Does not retain `Self` when calling method that returns `Self`. Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`. Does not retain `Self` when accessing attribute through `type[Self]`. |
Pass | Partial Doesn't allow accessing `Self` in a classmethod |
Pass* Treats attributes not initialized on the class as instance-only |
| generics_self_attributes | Pass | Pass | Pass | Pass |
| generics_self_basic | Pass | Pass | Pass | Partial Return annotation of Self allows returning the concrete instance of the current class. |
| generics_self_protocols | Pass | Pass | Pass | Pass |
| generics_self_usage | Pass | Pass | Partial Does not detect invalid Self when Self is not properly bound |
Partial Does not implement some restrictions on where Self can be used |
| generics_syntax_compatibility | Pass | Pass | Pass | Pass |
| generics_syntax_declarations | Pass | Pass | Pass | Pass |
| generics_syntax_infer_variance | Unsupported Type parameter syntax not yet support. |
Pass | Partial Final is handled a bit different (questionable if this is an issue) |
Pass |
| generics_syntax_scoping | Partial Does not following runtime scoping rules for type parameters in all cases. |
Pass | Partial Does not following runtime scoping rules for type parameters in all cases. |
Partial Does not implement some scoping restrictions for PEP695 generic syntax |
| generics_type_erasure | Partial Infers Node[Never] instead of Node[Any] when argument is not provided. False negative on instance attribute access on type(node). |
Pass | Partial Infers Node[Never] instead of Node[Any] when argument is not provided. |
Pass |
| generics_typevartuple_args | Partial Does not enforce that tuples captured by TypeVarTuple are same type. |
Pass | Partial Does not enforce that tuples captured by TypeVarTuple are same type. |
Pass |
| generics_typevartuple_basic | Partial Does not enforce that tuples captured by TypeVarTuple are same length. Does not enforce that tuples captured by TypeVarTuple are same type. |
Pass | Partial Does not enforce that tuples captured by TypeVarTuple are same length. Does not enforce that tuples captured by TypeVarTuple are same type. |
Partial TypeVarTuple is pinned too early when calling generic function |
| generics_typevartuple_callable | Pass | Pass | Pass | Pass |
| generics_typevartuple_concat | Pass | Pass | Pass | Partial Fails to handle move_first_element_to_last example |
| generics_typevartuple_overloads | Pass | Pass | Pass | Pass |
| generics_typevartuple_specialization | Partial Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided. Rejects specialization of generic type alias defined as a tuple containing a TypeVar. |
Pass | Pass | Partial Sometimes specializes to tuple[Any, ...] instead of empty tuple |
| generics_typevartuple_unpack | Pass | Pass | Pass | Pass |
| generics_upper_bound | Partial Does not reject use of type variable within an upper bound. |
Pass | Partial Does not reject use of type variable within an upper bound. |
Pass |
| generics_variance | Partial Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. |
Pass | Partial Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. |
Unsupported |
| generics_variance_inference | Pass | Pass | Pass | Pass |
| Type qualifiers | ||||
| qualifiers_annotated | Partial Does not allow ClassVar to be nested within Annotated. Does not allow Final to be nested within Annotated. Does not allow Required and NotRequired to be nested within Annotated. Does not reject type[T] compatibility for type alias defined with Annotated. Does not reject call of type alias defined with Annotated. |
Pass | Pass | Partial Allows Annotated in some contexts where it should not be allowed |
| qualifiers_final_annotation | Partial Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. Does not allow conditional assignment of Final instance variable in __init__ method. Does not allow redefinition of private class variable that is marked Final in parent class. Does not report modification of local Final variable via "for" statement. |
Pass | Partial Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. Does not allow conditional assignment of Final instance variable in __init__ method. |
Partial Final attributes not initialized on the class can be assigned to |
| qualifiers_final_decorator | Pass | Pass | Pass | Pass |
| Class type compatibility | ||||
| classes_classvar | Partial Internal error if TypeVarTuple is used in ClassVar. Does not reject use of ParamSpec in ClassVar. Rejects ClassVar nested in Annotated. Does not reject use of ClassVar in TypeAlias definition. |
Pass | Pass | Pass |
| classes_override | Pass | Pass | Pass | Pass |
| Type aliases | ||||
| aliases_explicit | Partial Does not reject specialization of type alias that has already been implicitly specialized. |
Pass | Pass | Pass |
| aliases_implicit | Pass | Pass | Pass | Partial Does not reject invalid syntax in implicit type aliases. |
| aliases_newtype | Partial `NewType`s are incorrectly considered to be classes. |
Pass | Pass | Pass |
| aliases_recursive | Pass | Pass | Pass | Unsupported |
| aliases_type_statement | Partial Does not reject type alias defined in function scope. |
Pass | Pass | Partial Does not reject redeclaration of type alias with the same name. Does not detect circular definitions. |
| aliases_typealiastype | Partial Incorrectly rejects some recursive type aliases using TypeAliasType. Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. |
Pass | Partial Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. Incorrectly allows type_params= to be an arbitrary tuple. |
Partial Does not detect circular definitions. |
| aliases_variance | Pass | Pass | Pass | Unsupported |
| Literals | ||||
| literals_interactions | Partial Does not narrow type of `x` with `x in Literal` type guard pattern. |
Pass | Partial Does not narrow type of `x` with `x in Literal` type guard pattern. |
Partial Two instances parameterized with different literals are not compatible |
| literals_literalstring | Unsupported Support for `LiteralString` is not implemented. |
Pass | Pass | Pass |
| literals_parameterizations | Partial Does not reject tuple within Literal. |
Pass | Pass | Pass |
| literals_semantics | Pass | Pass | Pass | Pass |
| Protocols | ||||
| protocols_class_objects | Pass | Pass | Pass | Partial Does not require concrete classes to be passed to type[Proto] |
| protocols_definition | Partial Does not detect protocol mismatch if concrete method is missing annotations. Does not detect protocol mismatch if concrete method's parameters are position-only. |
Pass | Partial Does not detect protocol mismatch if concrete method is missing annotations. Does not detect protocol mismatch if concrete method's parameters are position-only. |
Partial Incorrectly handles some ClassVar examples in Protocol subtyping |
| protocols_explicit | Pass* Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated. |
Pass | Pass | Partial Does not reject call to super method with no default implementation. Does not detect stub methods inherited from protocols as abstract. |
| protocols_generic | Pass | Pass | Pass | Pass |
| protocols_merging | Pass | Pass | Pass | Pass |
| protocols_modules | Pass | Pass | Pass | Partial Fails one subtyping example of protocol modules |
| protocols_recursive | Pass | Pass | Pass | Pass |
| protocols_runtime_checkable | Partial Does not report unsafe overlap for runtime_checkable protocol. |
Pass | Partial Does not report unsafe overlap for runtime_checkable protocol. |
Partial Does not check for unsafe overlap in runtime_checkable protocols |
| protocols_self | Pass | Pass | Pass | Pass |
| protocols_subtyping | Pass | Pass | Pass | Pass |
| protocols_variance | Pass | Pass | Pass | Unsupported |
| Callables | ||||
| callables_annotation | Partial Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any. Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter. |
Pass | Partial Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any. Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter. |
Partial Parameter names are lost when resolving ParamSpec |
| callables_kwargs | Partial Allows callable without kwargs to be assigned to callable with unpacked kwargs |
Pass | Pass | Pass |
| callables_protocol | Pass | Pass | Pass | Pass |
| callables_subtyping | Pass | Pass | Pass | Pass |
| Constructors | ||||
| constructors_call_init | Partial Does not report errors during binding to self parameter of __init__ method. Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. |
Pass | Partial Does not report errors during binding to self parameter of __init__ method. Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. |
Partial Does not reject class-scoped type var in self param annotation |
| constructors_call_metaclass | Unupported Does not honor metaclass __call__ method when evaluating constructor call. Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class. |
Pass | Pass | Pass |
| constructors_call_new | Partial Does not support __new__ return type that is not a subclass of the class being constructed. Does not skip evaluation of __init__ based on __new__ return type. Does not report errors during binding to cls parameter of __new__ method. |
Pass | Partial Does not support __new__ return type that is not a subclass of the class being constructed. Does not skip evaluation of __init__ based on __new__ return type. Does not report errors during binding to cls parameter of __new__ method. |
Pass |
| constructors_call_type | Partial Does not validate call to custom metaclass __call__ method through type[T]. |
Pass | Partial Does not validate call to custom metaclass __call__ method through type[T]. |
Partial Does not check TypeVar type constructor using upper bound's __new__ |
| constructors_callable | Partial Does not generate a union type for __new__ and __init__ when converting class to callable. Does not ignore __init__ based on __new__ return type when converting class to callable. Does not support __new__ return type that is different from class being constructed. |
Pass | Partial Does not generate a union type for __new__ and __init__ when converting class to callable. Does not ignore __init__ based on __new__ return type when converting class to callable. Does not support __new__ return type that is different from class being constructed. Struggles with some cases of self types |
Partial Converting constructor to callable does not preserve class-scoped type params. Converting constructor to callable does not substitute Self in __new__ Converting constructor to callable uses __new__ signature instead of __init__ |
| constructors_consistency | Pass* Does not report inconsistency between __new__ and __init__ (optional). |
Pass | Pass | Pass |
| Overloads | ||||
| overloads_basic | Pass | Pass | Pass | Pass |
| overloads_consistency | Pass | Pass | Pass | Pass |
| overloads_definitions | Partial Allows @override to be on all overloads and implementation, instead of just implementation. |
Pass | Pass | Pass |
| overloads_definitions_stub | Partial Allows @override to appear in a stub file not on the first overload. |
Pass | Pass | Pass |
| overloads_evaluation | Partial Does not expand boolean arguments to Literal[True] and Literal[False]. Does not expand enum arguments to literal variants. Does not expand tuple arguments to possible combinations. Does not evaluate Any in some cases where overload is ambiguous. Evaluates Any in some cases where overload is not ambiguous. |
Partial Does not evaluate Any in some cases where overload is ambiguous. |
Partial Does not expand boolean arguments to Literal[True] and Literal[False]. Does not expand enum arguments to literal variants. Does not expand tuple arguments to possible combinations. Does not evaluate Any in some cases where overload is ambiguous. Evaluates Any in some cases where overload is not ambiguous. |
Pass |
| Exceptions | ||||
| exceptions_context_managers | Pass | Pass | Pass | Partial Some error suppressing context managers are not detected |
| Dataclasses | ||||
| dataclasses_descriptors | Partial Does not correctly evaluate type of descriptor access. |
Pass | Pass | Pass |
| dataclasses_final | Partial Wrongly requires a Final dataclass field to be initialized at class level. Doesn't support Final nested inside ClassVar. |
Pass | Partial Wrongly requires a Final dataclass field to be initialized at class level. Doesn't support Final nested inside ClassVar. |
Partial Allows assignment to final attributes that are not initialized on the class |
| dataclasses_frozen | Pass | Pass | Pass | Pass |
| dataclasses_hash | Partial Does not report when dataclass is not compatible with Hashable protocol. |
Pass | Partial Does not report when dataclass is not compatible with Hashable protocol. |
Pass |
| dataclasses_inheritance | Pass | Pass | Pass | Pass |
| dataclasses_kwonly | Pass | Pass | Pass | Pass |
| dataclasses_match_args | Pass | Pass | Pass | Pass |
| dataclasses_order | Pass | Pass | Pass | Pass |
| dataclasses_postinit | Pass | Pass | Pass | Pass |
| dataclasses_slots | Partial Does not reject write to instance variable that is not defined in __slots__. |
Pass | Partial Does not reject write to instance variable that is not defined in __slots__. |
Partial __slots__ is generated but not checked during attribute assignment |
| dataclasses_transform_class | Pass | Pass | Pass | Pass |
| dataclasses_transform_converter | Unsupported Converter parameter not yet supported. |
Pass | Partial Converters are fully supported, failed to match generic overloads against other generics |
Pass |
| dataclasses_transform_field | Partial Does not properly handle field constructor that has default value for `kw_only` or `init` parameter. |
Pass | Pass | Pass |
| dataclasses_transform_func | Partial Does not handle `kw_only=False` override when `kw_only_default=True`. Does not report error when `order=False` and comparison operators are used. |
Pass | Pass | Pass |
| dataclasses_transform_meta | Pass | Pass | Pass | Pass |
| dataclasses_usage | Pass* Does not detect unannotated usage of `dataclasses.field()`. |
Pass | Pass | Pass |
| Typed dictionaries | ||||
| typeddicts_alt_syntax | Pass* Does not support keyword-argument form of alternative syntax (deprecated in 3.11). |
Pass | Pass* Does not support keyword-argument form of alternative syntax (deprecated in 3.11). |
Pass |
| typeddicts_class_syntax | Pass | Pass | Pass | Pass |
| typeddicts_extra_items | Unsupported Not supported. |
Pass | Pass | Pass |
| typeddicts_final | Pass | Pass | Pass | Pass |
| typeddicts_inheritance | Pass | Pass | Pass | Pass |
| typeddicts_operations | Pass | Pass | Pass | Pass |
| typeddicts_readonly | Pass | Pass | Pass | Pass |
| typeddicts_readonly_consistency | Pass | Pass | Pass | Pass |
| typeddicts_readonly_inheritance | Partial Incorrectly rejects non-ReadOnly override of ReadOnly item. Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. |
Pass | Partial Incorrectly rejects non-ReadOnly override of ReadOnly item. Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. |
Partial Does not restrictions around overriding for ReadOnly fields |
| typeddicts_readonly_kwargs | Pass | Pass | Pass | Pass |
| typeddicts_readonly_update | Partial Incorrectly allows update of ReadOnly item. Incorrectly rejects update involving an item with Never type. |
Pass | Partial Incorrectly allows update of ReadOnly item. |
Pass |
| typeddicts_required | Pass | Pass | Pass | Partial Does not handle recursive typed dicts in functional syntax |
| typeddicts_type_consistency | Pass | Pass | Pass | Pass |
| typeddicts_usage | Pass | Pass | Pass | Pass |
| Tuples | ||||
| tuples_type_compat | Partial Does not support tuple narrowing based on `len()` type guard (optional). |
Pass | Pass* Does not support tuple narrowing based on `len()` type guard (optional). |
Pass |
| tuples_type_form | Pass | Pass | Pass | Pass |
| tuples_unpacked | Partial "More than one unpack" error is missing in some cases. |
Pass | Pass | Pass |
| Named tuples | ||||
| namedtuples_define_class | Partial Does not reject override of named tuple attribute in child class. |
Pass | Partial Does not reject override of named tuple attribute in child class. |
Pass |
| namedtuples_define_functional | Pass | Partial | Pass | Pass |
| namedtuples_type_compat | Pass | Pass | Pass | Pass |
| namedtuples_usage | Partial Does not reject attempt to delete named tuple field by name. |
Pass | Pass | Pass |
| Enumerations | ||||
| enums_behaviors | Pass | Pass | Pass | Pass |
| enums_definition | Pass | Pass | Pass | Pass |
| enums_expansion | Partial Improperly applies narrowing to Flag subclass. |
Pass | Partial Improperly applies narrowing to Flag subclass. |
Pass |
| enums_member_names | Pass* Does not support special-cased handling of member name literal types in some cases (optional). |
Pass | Pass | Pass |
| enums_member_values | Partial Does not enforce declared type of `_value_`. Does not enforce assigned tuple types for enum members (optional). |
Pass | Partial Does not enforce declared type of `_value_`. |
Pass |
| enums_members | Partial Does not treat attribute with annotation and no assignment as non-member. Does not treat callables as non-members. Does not honor `enum.member` as method decorator. Does not properly handle aliased enum members. Does not support `_ignore_` mechanism (optional). Does not treat attributes with private names as non-members. |
Pass* Does not support `_ignore_` mechanism (optional). |
Partial Does not honor `enum.member` as method decorator. Does not properly handle aliased enum members. Does not treat somecallables as non-members. |
Partial Enum members that are aliases of other members do not resolved to the aliased member's type |
| Type narrowing | ||||
| narrowing_typeguard | Pass | Pass | Pass | Pass |
| narrowing_typeis | Pass | Pass | Pass | Pass |
| Type checker directives | ||||
| directives_assert_type | Pass | Pass | Pass | Pass |
| directives_cast | Pass | Pass | Pass | Pass |
| directives_deprecated | Pass | Pass | Pass | Pass |
| directives_no_type_check | Partial Does not honor `@no_type_check` class decorator (allowed). Does not reject invalid call of `@no_type_check` function. |
Pass* Does not honor `@no_type_check` class decorator (allowed). |
Pass | Pass |
| directives_reveal_type | Pass | Pass | Pass | Pass |
| directives_type_checking | Pass | Pass | Pass | Pass |
| directives_type_ignore | Partial Does not honor "# type: ignore" comment if comment includes additional text. |
Pass | Partial Does not honor "# type: ignore" comment if comment includes additional text. |
Pass |
| directives_type_ignore_file1 | Pass | Pass | Pass | Pass |
| directives_type_ignore_file2 | Pass | Pass | Pass | Pass |
| directives_version_platform | Pass* Does not understand three-element form of sys.version checks. Does not understand os.name checks. |
Pass | Pass | Pass |
| 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. |
Pass |