module documentation

Classification of possible errors mypy can detect. These can be used for filtering specific errors.

Class ErrorCode Undocumented
Constant ABSTRACT Undocumented
Constant ANNOTATION_UNCHECKED Undocumented
Constant ARG_TYPE Undocumented
Constant ASSERT_TYPE Undocumented
Constant ASSIGNMENT Undocumented
Constant ATTR_DEFINED Undocumented
Constant CALL_ARG Undocumented
Constant CALL_OVERLOAD Undocumented
Constant COMPARISON_OVERLAP Undocumented
Constant DICT_ITEM Undocumented
Constant EMPTY_BODY Undocumented
Constant EXIT_RETURN Undocumented
Constant FILE Undocumented
Constant FUNC_RETURNS_VALUE Undocumented
Constant HAS_TYPE Undocumented
Constant IGNORE_WITHOUT_CODE Undocumented
Constant IMPORT Undocumented
Constant INDEX Undocumented
Constant LIST_ITEM Undocumented
Constant LITERAL_REQ Undocumented
Constant METHOD_ASSIGN Undocumented
Constant MISC Undocumented
Constant NAME_DEFINED Undocumented
Constant NAME_MATCH Undocumented
Constant NO_ANY_RETURN Undocumented
Constant NO_ANY_UNIMPORTED Undocumented
Constant NO_OVERLOAD_IMPL Undocumented
Constant NO_REDEF Undocumented
Constant NO_UNTYPED_CALL Undocumented
Constant NO_UNTYPED_DEF Undocumented
Constant OPERATOR Undocumented
Constant OVERRIDE Undocumented
Constant POSSIBLY_UNDEFINED Undocumented
Constant REDUNDANT_CAST Undocumented
Constant REDUNDANT_EXPR Undocumented
Constant REDUNDANT_SELF_TYPE Undocumented
Constant RETURN Undocumented
Constant RETURN_VALUE Undocumented
Constant SAFE_SUPER Undocumented
Constant STR_BYTES_PY3 Undocumented
Constant STRING_FORMATTING Undocumented
Constant SYNTAX Undocumented
Constant TRUTHY_BOOL Undocumented
Constant TRUTHY_FUNCTION Undocumented
Constant TRUTHY_ITERABLE Undocumented
Constant TYPE_ABSTRACT Undocumented
Constant TYPE_ARG Undocumented
Constant TYPE_VAR Undocumented
Constant TYPEDDICT_ITEM Undocumented
Constant TYPEDDICT_UNKNOWN_KEY Undocumented
Constant UNION_ATTR Undocumented
Constant UNREACHABLE Undocumented
Constant UNUSED_AWAITABLE Undocumented
Constant UNUSED_COROUTINE Undocumented
Constant USED_BEFORE_DEF Undocumented
Constant VALID_NEWTYPE Undocumented
Constant VALID_TYPE Undocumented
Constant VAR_ANNOTATED Undocumented
Variable error_codes Undocumented
Variable sub_code_map Undocumented
ABSTRACT = (source)

Undocumented

Value
ErrorCode('abstract',
          'Prevent instantiation of classes with abstract attributes',
          'General')
ANNOTATION_UNCHECKED = (source)

Undocumented

Value
ErrorCode('annotation-unchecked',
          'Notify about type annotations in unchecked functions',
          'General')
ARG_TYPE = (source)

Undocumented

Value
ErrorCode('arg-type', 'Check argument types in calls', 'General')
ASSERT_TYPE = (source)

Undocumented

Value
ErrorCode('assert-type', 'Check that assert_type() call succeeds', 'General')

Undocumented

Value
ErrorCode('assignment',
          'Check that assigned value is compatible with target',
          'General')
ATTR_DEFINED = (source)

Undocumented

Value
ErrorCode('attr-defined', 'Check that attribute exists', 'General')

Undocumented

Value
ErrorCode('call-arg',
          'Check number, names and kinds of arguments in calls',
          'General')
CALL_OVERLOAD = (source)

Undocumented

Value
ErrorCode('call-overload',
          'Check that an overload variant matches arguments',
          'General')
COMPARISON_OVERLAP = (source)

Undocumented

Value
ErrorCode('comparison-overlap',
          'Check that types in comparisons and \'in\' expressions overlap',
          'General')
DICT_ITEM = (source)

Undocumented

Value
ErrorCode('dict-item',
          'Check dict items in a dict expression {key: value, ...}',
          'General')

Undocumented

Value
ErrorCode('empty-body',
          'A dedicated error code to opt out return errors for empty/trivial bod
ies',
          'General')
EXIT_RETURN = (source)

Undocumented

Value
ErrorCode('exit-return',
          'Warn about too general return type for \'__exit__\'',
          'General')

Undocumented

Value
ErrorCode('file', 'Internal marker for a whole file being ignored', 'General')
FUNC_RETURNS_VALUE = (source)

Undocumented

Value
ErrorCode('func-returns-value',
          'Check that called function returns a value in value context',
          'General')
HAS_TYPE = (source)

Undocumented

Value
ErrorCode('has-type', 'Check that type of reference can be determined', 'General'
)
IGNORE_WITHOUT_CODE = (source)

Undocumented

Value
ErrorCode('ignore-without-code',
          'Warn about \'# type: ignore\' comments which do not have error codes'
,
          'General',
          default_enabled=False)

Undocumented

Value
ErrorCode('import',
          'Require that imported module can be found or has stubs',
          'General')

Undocumented

Value
ErrorCode('index', 'Check indexing operations', 'General')
LIST_ITEM = (source)

Undocumented

Value
ErrorCode('list-item',
          'Check list items in a list expression [item, ...]',
          'General')
LITERAL_REQ = (source)

Undocumented

Value
ErrorCode('literal-required', 'Check that value is a literal', 'General')
METHOD_ASSIGN: ErrorCode = (source)

Undocumented

Value
ErrorCode('method-assign',
          'Check that assignment target is not a method',
          'General',
          sub_code_of=ASSIGNMENT)

Undocumented

Value
ErrorCode('misc', 'Miscellaneous other checks', 'General')
NAME_DEFINED = (source)

Undocumented

Value
ErrorCode('name-defined', 'Check that name is defined', 'General')
NAME_MATCH = (source)

Undocumented

Value
ErrorCode('name-match',
          'Check that type definition has consistent naming',
          'General')
NO_ANY_RETURN = (source)

Undocumented

Value
ErrorCode('no-any-return',
          'Reject returning value with "Any" type if return type is not "Any"',
          'General')
NO_ANY_UNIMPORTED = (source)

Undocumented

Value
ErrorCode('no-any-unimported',
          'Reject "Any" types from unfollowed imports',
          'General')
NO_OVERLOAD_IMPL = (source)

Undocumented

Value
ErrorCode('no-overload-impl',
          'Check that overloaded functions outside stub files have an implementa
tion',
          'General')
NO_REDEF = (source)

Undocumented

Value
ErrorCode('no-redef', 'Check that each name is defined once', 'General')
NO_UNTYPED_CALL = (source)

Undocumented

Value
ErrorCode('no-untyped-call',
          'Disallow calling functions without type annotations from annotated fu
nctions',
          'General')
NO_UNTYPED_DEF: ErrorCode = (source)

Undocumented

Value
ErrorCode('no-untyped-def',
          'Check that every function has an annotation',
          'General')
OPERATOR = (source)

Undocumented

Value
ErrorCode('operator', 'Check that operator is valid for operands', 'General')
OVERRIDE = (source)

Undocumented

Value
ErrorCode('override',
          'Check that method override is compatible with base class',
          'General')
POSSIBLY_UNDEFINED: ErrorCode = (source)

Undocumented

Value
ErrorCode('possibly-undefined',
          'Warn about variables that are defined only in some execution paths',
          'General',
          default_enabled=False)
REDUNDANT_CAST = (source)

Undocumented

Value
ErrorCode('redundant-cast',
          'Check that cast changes type of expression',
          'General')
REDUNDANT_EXPR = (source)

Undocumented

Value
ErrorCode('redundant-expr', 'Warn about redundant expressions', 'General',
          default_enabled=False)
REDUNDANT_SELF_TYPE = (source)

Undocumented

Value
ErrorCode('redundant-self',
          'Warn about redundant Self type annotations on method first argument',
          'General',
          default_enabled=False)

Undocumented

Value
ErrorCode('return', 'Check that function always returns a value', 'General')
RETURN_VALUE: ErrorCode = (source)

Undocumented

Value
ErrorCode('return-value',
          'Check that return value is compatible with signature',
          'General')
SAFE_SUPER = (source)

Undocumented

Value
ErrorCode('safe-super',
          'Warn about calls to abstract methods with empty/trivial bodies',
          'General')
STR_BYTES_PY3 = (source)

Undocumented

Value
ErrorCode('str-bytes-safe',
          'Warn about dangerous coercions related to bytes and string types',
          'General')
STRING_FORMATTING = (source)

Undocumented

Value
ErrorCode('str-format',
          'Check that string formatting/interpolation is type-safe',
          'General')

Undocumented

Value
ErrorCode('syntax', 'Report syntax errors', 'General')

Undocumented

Value
ErrorCode('truthy-bool',
          'Warn about expressions that could always evaluate to true in boolean 
contexts',
          'General',
          default_enabled=False)
TRUTHY_FUNCTION: ErrorCode = (source)

Undocumented

Value
ErrorCode('truthy-function',
          'Warn about function that always evaluate to true in boolean contexts'
,
          'General')
TRUTHY_ITERABLE: ErrorCode = (source)

Undocumented

Value
ErrorCode('truthy-iterable',
          'Warn about Iterable expressions that could always evaluate to true in
 boolean contexts',
          'General',
          default_enabled=False)
TYPE_ABSTRACT = (source)

Undocumented

Value
ErrorCode('type-abstract',
          'Require only concrete classes where Type[...] is expected',
          'General')
TYPE_ARG = (source)

Undocumented

Value
ErrorCode('type-arg', 'Check that generic type arguments are present', 'General'
)
TYPE_VAR = (source)

Undocumented

Value
ErrorCode('type-var', 'Check that type variable values are valid', 'General')
TYPEDDICT_ITEM = (source)

Undocumented

Value
ErrorCode('typeddict-item', 'Check items when constructing TypedDict', 'General'
)
TYPEDDICT_UNKNOWN_KEY = (source)

Undocumented

Value
ErrorCode('typeddict-unknown-key',
          'Check unknown keys when constructing TypedDict',
          'General',
          sub_code_of=TYPEDDICT_ITEM)
UNION_ATTR = (source)

Undocumented

Value
ErrorCode('union-attr',
          'Check that attribute exists in each item of a union',
          'General')
UNREACHABLE = (source)

Undocumented

Value
ErrorCode('unreachable',
          'Warn about unreachable statements or expressions',
          'General')
UNUSED_AWAITABLE = (source)

Undocumented

Value
ErrorCode('unused-awaitable',
          'Ensure that all awaitable values are used',
          'General',
          default_enabled=False)
UNUSED_COROUTINE = (source)

Undocumented

Value
ErrorCode('unused-coroutine', 'Ensure that all coroutines are used', 'General')
USED_BEFORE_DEF: ErrorCode = (source)

Undocumented

Value
ErrorCode('used-before-def',
          'Warn about variables that are used before they are defined',
          'General')
VALID_NEWTYPE = (source)

Undocumented

Value
ErrorCode('valid-newtype', 'Check that argument 2 to NewType is valid', 'General'
)

Undocumented

Value
ErrorCode('valid-type', 'Check that type (annotation) is valid', 'General')
VAR_ANNOTATED = (source)

Undocumented

Value
ErrorCode('var-annotated',
          'Require variable annotation if type can\'t be inferred',
          'General')

Undocumented

sub_code_map: dict[str, set[str]] = (source)

Undocumented