Undocumented
Class | DefaultPlugin |
Type checker plugin that is enabled by default. |
Function | contextmanager_callback |
Infer a better return type for 'contextlib.contextmanager'. |
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 | open_callback |
Infer a better return type for 'open'. |
Function | path_open_callback |
Infer a better return type for 'pathlib.Path.open'. |
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. |
Function | _analyze_open_signature |
A helper for analyzing any function that has approximately the same signature as the builtin 'open(...)' function. |
Parameters | |
ctx:FunctionContext | Undocumented |
Returns | |
Type | Undocumented |
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
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
Parameters | |
ctx:FunctionContext | Undocumented |
Returns | |
Type | Undocumented |
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
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
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
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.
Parameters | |
ctx:MethodSigContext | Undocumented |
Returns | |
CallableType | Undocumented |
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
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.
Parameters | |
ctx:MethodSigContext | Undocumented |
Returns | |
CallableType | Undocumented |
Parameters | |
ctx:MethodContext | Undocumented |
Returns | |
Type | Undocumented |
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.
Parameters | |
ctx:MethodSigContext | Undocumented |
Returns | |
CallableType | Undocumented |
Parameters | |
ctx:MethodSigContext | Undocumented |
Returns | |
CallableType | Undocumented |
A helper for analyzing any function that has approximately the same signature as the builtin 'open(...)' function.
Currently, the only thing the caller can customize is the index of the 'mode' argument. If the mode argument is omitted or is a string literal, we refine the return type to either 'TextIO' or 'BinaryIO' as appropriate.
Parameters | |
arg_types:List[ | Undocumented |
args:List[ | Undocumented |
mode_arg_index:int | Undocumented |
default_return_type:Type | Undocumented |
api:CheckerPluginInterface | Undocumented |
Returns | |
Type | Undocumented |