Categories
This page describes the different categories of type system unsoundness that the checker can detect.
runtime-modification
Runtime code modifications that escape static type checker analysis.
Rules in this category
invalid-function-defaults- detects invalid mutation of the__defaults__attribute of a functionmutating-function-code-attribute- detects mutating the__code__attribute of a functionmutating-globals-dict- detects mutations to theglobals()dictionarymutable-generic-default- detects mutable default arguments in generic functionsinvalid-setattr- detects invalid usage ofsetattr()built-in function
type-checking-suppression
Mechanisms that suppress or bypass type checker warnings.
Rules in this category
typing-any-used- detects usage oftyping.Anyin type annotationsinvalid-overload-implementation- detects invalid overload implementationtyping-overload-used- detects usage of overloaded functionstype-checking-directive-used- detects usage of type checking directives in commentsif-type-checking-used- detects usage ofif TYPE_CHECKING:blockstyping-cast-used- detects usage oftyping.cast()function callstyping-type-is-used- detects usage oftyping.TypeIsin return type annotationscallable-ellipsis-used- detects usage of...in the first argument ofCallabletype annotationsmangled-dunder-instance-variable- detects explicit usage of mangled dunder instance variables