module documentation

Undocumented

Class DefaultPlugin Type checker plugin that is enabled by default.
Function int_neg_callback Infer a more precise return type for int.__neg__.
Function int_pow_callback Infer a more precise return type for int.__pow__.
Function tuple_mul_callback Infer a more precise return type for tuple.__mul__ and tuple.__rmul__.
Function typed_dict_delitem_callback Type check TypedDict.__delitem__.
Function typed_dict_get_callback Infer a precise return type for TypedDict.get with literal first argument.
Function typed_dict_get_signature_callback Try to infer a better signature type for TypedDict.get.
Function typed_dict_pop_callback Type check and infer a precise return type for TypedDict.pop.
Function typed_dict_pop_signature_callback Try to infer a better signature type for TypedDict.pop.
Function typed_dict_setdefault_callback Type check TypedDict.setdefault and infer a precise return type.
Function typed_dict_setdefault_signature_callback Try to infer a better signature type for TypedDict.setdefault.
Function typed_dict_update_signature_callback Try to infer a better signature type for TypedDict.update.
def int_neg_callback(ctx: MethodContext) -> Type: (source)

Infer a more precise return type for int.__neg__. This is mainly used to infer the return type as LiteralType if the original underlying object is a LiteralType object

def int_pow_callback(ctx: MethodContext) -> Type: (source)

Infer a more precise return type for int.__pow__.

def tuple_mul_callback(ctx: MethodContext) -> Type: (source)

Infer a more precise return type for tuple.__mul__ and tuple.__rmul__. This is used to return a specific sized tuple if multiplied by Literal int

def typed_dict_delitem_callback(ctx: MethodContext) -> Type: (source)

Type check TypedDict.__delitem__.

def typed_dict_get_callback(ctx: MethodContext) -> Type: (source)

Infer a precise return type for TypedDict.get with literal first argument.

def typed_dict_get_signature_callback(ctx: MethodSigContext) -> CallableType: (source)

Try to infer a better signature type for TypedDict.get. This is used to get better type context for the second argument that depends on a TypedDict value type.

def typed_dict_pop_callback(ctx: MethodContext) -> Type: (source)

Type check and infer a precise return type for TypedDict.pop.

def typed_dict_pop_signature_callback(ctx: MethodSigContext) -> CallableType: (source)

Try to infer a better signature type for TypedDict.pop. This is used to get better type context for the second argument that depends on a TypedDict value type.

def typed_dict_setdefault_callback(ctx: MethodContext) -> Type: (source)

Type check TypedDict.setdefault and infer a precise return type.

def typed_dict_setdefault_signature_callback(ctx: MethodSigContext) -> CallableType: (source)

Try to infer a better signature type for TypedDict.setdefault. This is used to get better type context for the second argument that depends on a TypedDict value type.

def typed_dict_update_signature_callback(ctx: MethodSigContext) -> CallableType: (source)

Try to infer a better signature type for TypedDict.update.