|
Type annotations
|
| annotations_coroutines |
Pass |
Pass |
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.
|
Partial
- Fails to reject
"x" | int annotations that fail at runtime.
- Rejects some valid quoted annotations.
|
Partial
- Types in quotes incorrectly refer to shadowing class member.
- Does not reject some type forms that require quotes.
|
Pass |
Partial
|
Partial
- Incorrectly generates error for quoted type defined in class scope.
|
| annotations_generators |
Partial
- Does not report incompatible
Generator type in yield from statement.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| annotations_methods |
Pass
- Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.
|
Pass |
Pass |
Pass
- Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.
|
Pass |
Pass |
| annotations_typeexpr |
Pass |
Partial
- Fails to reject various weird annotations
|
Pass |
Pass |
Pass |
Pass |
|
4 / 5 • 80.0% |
4 / 5 • 80.0% |
4.5 / 5 • 90.0% |
5 / 5 • 100.0% |
4.5 / 5 • 90.0% |
4.5 / 5 • 90.0% |
|
Generics
|
| generics_base_class |
Partial
- Does not detect inconsistent type variable ordering.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_basic |
Pass |
Pass |
Pass |
Pass |
Partial
- Incorrectly allows constrained type variables to be solved to a union of their constraints.
|
Pass |
| generics_defaults |
Partial
- Does not detect a
TypeVar with a default used after a TypeVarTuple.
- Does not fully support defaults on
TypeVarTuple and ParamSpec.
|
Partial
- Numerous issues; does not support
TypeVarTuple and ParamSpec defaults.
|
Pass |
Pass |
Partial
- Does not forbid a
TypeVar immediately following a TypeVarTuple in a parameter list from having a default.
- Does not accept a
TypeVarTuple default that unpacks another in-scope TypeVarTuple.
- Does not correctly specialize a generic that combines a
TypeVarTuple with a defaulted ParamSpec.
|
Pass |
| generics_defaults_referential |
Partial
- Does not correctly handle defaults referencing other
TypeVars.
|
Partial
- Fails to apply default specializations in some cases.
|
Pass |
Pass |
Pass |
Pass |
| generics_defaults_specialization |
Partial
- Does not correctly resolve defaults when classes are used directly.
|
Pass |
Pass |
Partial
- Allows incorrect assignment to
type[].
|
Pass |
Pass |
| generics_paramspec_basic |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_paramspec_components |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_paramspec_semantics |
Pass |
Pass |
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 |
Pass |
Pass |
| generics_scoping |
Pass |
Pass |
Pass |
Pass |
Partial
- Does not reject
list[T]() in the global scope, where T is an unbound type variable.
- Does not reject
alias: TypeAlias = list[T] in the body scope of a class generic over a type variable T.
|
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 |
Pass
- Treats attributes not initialized on the class as instance-only.
|
Pass |
Pass |
Pass |
| generics_self_attributes |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_self_basic |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_self_protocols |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_self_usage |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_syntax_compatibility |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_syntax_declarations |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_syntax_infer_variance |
Unsupported
- Type parameter syntax not yet supported.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_syntax_scoping |
Partial
- Does not following runtime scoping rules for type parameters in all cases.
|
Partial
- Misses some details of scoping rules.
|
Pass |
Pass |
Pass |
Pass |
| 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 |
Pass |
Pass |
Partial
- Does not reject access of generic instance variable from the class object.
|
Pass |
| generics_typevartuple_args |
Partial
- Does not enforce that tuples captured by
TypeVarTuple are of the same length.
|
Pass |
Pass |
Partial
- Does not correctly solve
TypeVarTuple with heterogeneous bounds.
|
Partial
- Only partially supports
TypeVarTuple in *args annotations.
|
Pass |
| generics_typevartuple_basic |
Partial
- Does not enforce that tuples captured by
TypeVarTuple are same length.
|
Pass |
Pass |
Partial
- Does not correctly solve
TypeVarTuple with heterogeneous bounds.
|
Pass |
Pass |
| generics_typevartuple_callable |
Pass |
Pass |
Pass |
Pass |
Partial
- Does not correctly infer a
TypeVarTuple that appears between fixed leading and trailing parameters in *args.
|
Pass |
| generics_typevartuple_concat |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_typevartuple_overloads |
Pass |
Pass |
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 |
Pass |
Pass |
Pass |
| generics_typevartuple_unpack |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_upper_bound |
Partial
- Does not reject use of type variable within an upper bound.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_variance |
Partial
- Does not reject use of class-scoped
TypeVar used in a base class when variance is incompatible.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| generics_variance_inference |
Partial
- polymorphic functions with bound self type influence variance inference,
- which is not part of the variance inference algorithm as described in the spec.
- See gh-2281 for details.
|
Pass |
Pass |
Pass |
Pass |
Partial
- polymorphic functions with bound self type influence variance inference,
- which is not part of the variance inference algorithm as described in the spec.
- See gh-2281 for details.
|
|
22.5 / 30 • 75.0% |
28.5 / 30 • 95.0% |
30 / 30 • 100.0% |
28.5 / 30 • 95.0% |
27 / 30 • 90.0% |
29.5 / 30 • 98.3% |
|
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 |
Pass |
Pass |
| classes_override |
Partial
- Does not honor
@override compatibility checks for __init__ and __new__:
- the incompatible constructor overrides in
ChildC2 are not flagged.
|
Partial
- Does not honor
@override compatibility checks for __init__ and __new__:
- the incompatible constructor overrides in
ChildC2 are not flagged.
|
Pass |
Partial
- Does not honor
@override compatibility checks for __init__ and __new__:
- the incompatible constructor overrides in
ChildC2 are not flagged.
|
Partial
- Does not honor
@override compatibility checks for __init__ and __new__:
- the incompatible constructor overrides in
ChildC2 are not flagged.
|
Partial
- Does not honor
@override compatibility checks for __init__ and __new__:
- the incompatible constructor overrides in
ChildC2 are not flagged.
|
|
1 / 2 • 50.0% |
1.5 / 2 • 75.0% |
2 / 2 • 100.0% |
1.5 / 2 • 75.0% |
1.5 / 2 • 75.0% |
1.5 / 2 • 75.0% |
|
Type aliases
|
| aliases_explicit |
Partial
- Does not reject specialization of type alias that has already been implicitly specialized.
|
Pass |
Pass |
Pass |
Partial
- Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with
Unknown, is invalidly specialized again.
|
Pass |
| aliases_implicit |
Pass |
Partial
- Fails to handle various weird annotations.
- Various bugs with resolving generic aliases.
|
Pass |
Pass |
Partial
- Does not reject variables with
Any or Unknown types when used as implicit type aliases.
- Falls short on full syntactic validation of type aliases.
|
Pass |
| aliases_newtype |
Partial
NewTypes are incorrectly considered to be classes.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| aliases_recursive |
Pass |
Pass |
Pass |
Pass |
Unsupported |
Pass |
| aliases_type_statement |
Pass |
Partial
- Fails to reject various weird annotations.
|
Pass |
Pass |
Partial
- Does not reject a generic type alias that recursively specializes itself with different type arguments.
|
Pass |
| aliases_typealiastype |
Partial
- Incorrectly rejects some recursive type aliases using
TypeAliasType.
- Incorrectly rejects the use of a class-scoped
TypeVar in a TypeAliasType definition.
|
Partial
- Rejects valid
ParamSpec specialization.
|
Pass |
Pass |
Partial
- Does not reject cyclically defined
TypeAliasType aliases.
|
Pass |
| aliases_variance |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
|
5.5 / 7 • 78.6% |
5.5 / 7 • 78.6% |
7 / 7 • 100.0% |
7 / 7 • 100.0% |
4 / 7 • 57.1% |
7 / 7 • 100.0% |
|
Protocols
|
| protocols_class_objects |
Pass |
Partial
- Abstract
type[Proto] still allows protocol class objects in some paths.
|
Pass |
Pass |
Partial
- Does not reject protocol classes where
type[Proto] requires a concrete class.
- Incorrectly considers instance attributes as satisfying protocol members on class objects.
|
Pass |
| protocols_definition |
Partial
- Does not detect protocol mismatch if concrete method is missing annotations.
- Does not detect protocol mismatch if concrete method's parameters are position-only.
|
Pass |
Pass |
Pass |
Partial
- Reports an implicit instance attribute in a
Protocol method only as a warning.
- Incorrectly considers an instance attribute on a concrete class as satisfying a
ClassVar protocol member.
|
Pass |
| protocols_explicit |
Pass
- Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.
|
Pass |
Pass |
Pass |
Unsupported
- Allows implicitly abstract protocol methods to be called via
super() on a protocol subclass.
- Allows instantiation of abstract subclasses of protocol classes.
|
Pass |
| protocols_generic |
Pass |
Partial
- Fails to reject duplicate generic/protocol bases.
- Treats global object as a literal.
|
Pass |
Pass |
Partial
- Only partially supports
@property protocol members.
|
Pass |
| protocols_merging |
Pass |
Pass |
Pass |
Pass |
Partial
- Does not reject attempted instantiation of abstract subclasses of protocols.
|
Pass |
| protocols_modules |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| protocols_recursive |
Pass |
Pass |
Pass |
Pass |
Partial
- Fails to solve a type variable involving a recursive generic protocol.
|
Pass |
| protocols_runtime_checkable |
Partial
- Does not report unsafe overlap for
runtime_checkable protocol.
|
Pass |
Pass |
Pass |
Partial
- Does not reject
isinstance() or issubclass() calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol.
|
Pass |
| protocols_self |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| protocols_subtyping |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| protocols_variance |
Pass |
Pass |
Pass |
Pass |
Unsupported |
Pass |
|
10 / 11 • 90.9% |
10 / 11 • 90.9% |
11 / 11 • 100.0% |
11 / 11 • 100.0% |
6 / 11 • 54.5% |
11 / 11 • 100.0% |
|
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 |
Pass |
Pass |
Partial
- Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.
- Does not reject class-scoped type variables used in the
self annotation.
|
Pass |
| constructors_call_metaclass |
Unsupported
- 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 |
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 |
Pass |
Pass |
Pass |
Pass |
| constructors_call_type |
Partial
- Does not validate call to custom metaclass
__call__ method through type[T].
|
Pass |
Pass |
Pass |
Pass |
Pass |
| 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 |
Pass |
Pass |
Partial
- Does not include
__init__ when __new__ returns Self.
- Does not ignore
__init__ when __new__ returns Any.
- Unions overload return types.
|
Pass |
| constructors_consistency |
Pass
- Does not report inconsistency between
__new__ and __init__ (optional).
|
Pass |
Pass |
Pass |
Pass |
Pass |
|
3 / 6 • 50.0% |
6 / 6 • 100.0% |
6 / 6 • 100.0% |
6 / 6 • 100.0% |
5 / 6 • 83.3% |
6 / 6 • 100.0% |
|
Dataclasses
|
| dataclasses_descriptors |
Partial
- Assumes descriptor behavior only when field is assigned in class body.
- Does not correctly evaluate type of descriptor access.
|
Partial
|
Partial
- Assumes descriptor behavior only when field is assigned in class body
- Doesn't allow non-data descriptors or data descriptors with differing
__get__ and __set__ types
|
Pass |
Partial
- Only infers a descriptor
__get__ method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace.
|
Pass |
| dataclasses_final |
Partial
- Wrongly requires a
Final dataclass field to be initialized at class level.
- Doesn't support
Final nested inside ClassVar.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_frozen |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_hash |
Unsupported
- Does not synthesize
__hash__ = None as a class attribute for unhashable dataclasses.
- Does not report when an unhashable dataclass has
__hash__ called directly on an instance.
- Does not report when dataclass is not compatible with
Hashable protocol.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_inheritance |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_kwonly |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_match_args |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_order |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_postinit |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_slots |
Partial
- Does not reject write to instance variable that is not defined in
__slots__.
|
Pass |
Pass |
Pass |
Partial
- Synthesizes a
__slots__ attribute but does not validate attribute assignments against __slots__.
|
Pass |
| dataclasses_transform_class |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_transform_converter |
Unsupported
- Converter parameter not yet supported.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_transform_field |
Partial
- Does not properly handle field constructor that has default value for
kw_only or init parameter.
|
Pass |
Pass |
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 |
Pass |
Pass |
| dataclasses_transform_meta |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| dataclasses_usage |
Pass
- Does not detect unannotated usage of
dataclasses.field().
|
Pass |
Pass |
Pass |
Pass |
Pass |
|
11.5 / 16 • 71.9% |
15.5 / 16 • 96.9% |
15.5 / 16 • 96.9% |
16 / 16 • 100.0% |
15 / 16 • 93.8% |
16 / 16 • 100.0% |
|
Enumerations
|
| enums_behaviors |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| enums_definition |
Pass |
Partial
- Does not allow enum members to be conditional on version/platform checks.
|
Pass |
Pass |
Pass |
Pass |
| enums_expansion |
Partial
- Improperly applies narrowing to
Flag subclass.
|
Pass |
Pass |
Partial
- Does not treat a complete union of all literal members as equivalent to the enum type.
|
Pass |
Partial
- Does not treat a complete union of all literal members as equivalent to the enum type.
|
| enums_member_names |
Pass
- Does not support special-cased handling of member name literal types in some cases (optional).
|
Pass |
Pass |
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 |
Pass |
Pass |
Pass |
Pass |
| enums_members |
Partial
- Does not treat attribute with annotation and no assignment as non-member.
- Does not treat callables as non-members.
- Does not honor
enum.member as method decorator.
- Does not properly handle aliased enum members.
- Does not support
_ignore_ mechanism (optional).
- Does not treat attributes with private names as non-members.
|
Pass |
Pass |
Pass
- Does not support
_ignore_ mechanism (optional).
|
Pass |
Pass |
|
4.5 / 6 • 75.0% |
5.5 / 6 • 91.7% |
6 / 6 • 100.0% |
5.5 / 6 • 91.7% |
6 / 6 • 100.0% |
5.5 / 6 • 91.7% |
|
Type checker directives
|
| directives_assert_type |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_cast |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_deprecated |
Pass |
Pass |
Pass |
Pass |
Partial
- Does not detect calls to deprecated overloads.
- Does not detect implicit calls to deprecated dunder methods, for example via operators.
- Does not detect accesses of, or attempts to set, deprecated properties.
|
Pass |
| directives_disjoint_base |
Pass |
Partial
- Does not reject invalid class definitions due to disjoint bases, but uses disjoint base information in type narrowing.
|
Pass |
Unsupported
- Does not support PEP 800 disjoint-base semantics.
|
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 |
Pass |
Pass
- Does not honor
@no_type_check class decorator (allowed).
|
Pass |
Pass |
| directives_reveal_type |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_type_checking |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_type_ignore |
Partial
- Does not honor
# type: ignore comment if comment includes additional text.
|
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_type_ignore_file1 |
Pass |
Pass |
Pass |
Pass |
Pass |
Pass |
| directives_type_ignore_file2 |
Pass |
Pass |
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 |
Pass |
Pass |
|
10 / 11 • 90.9% |
10.5 / 11 • 95.5% |
11 / 11 • 100.0% |
10 / 11 • 90.9% |
10.5 / 11 • 95.5% |
11 / 11 • 100.0% |