module documentation

Undocumented

Class RegisterCallableInfo Undocumented
Class SingledispatchTypeVars Undocumented
Function call_singledispatch_function_after_register_argument Called on the function after passing a type to register
Function call_singledispatch_function_callback Called for functools._SingleDispatchCallable.__call__
Function create_singledispatch_function_callback Called for functools.singledispatch
Function fail Emit an error message.
Function get_dispatch_type Undocumented
Function get_first_arg Get the element that corresponds to the first argument passed to the function
Function get_singledispatch_info Undocumented
Function make_fake_register_class_instance Undocumented
Function register_function Register a function
Function singledispatch_register_callback Called for functools._SingleDispatchCallable.register
Constant REGISTER_CALLABLE_CALL_METHOD Undocumented
Constant REGISTER_RETURN_CLASS Undocumented
Constant SINGLEDISPATCH_CALLABLE_CALL_METHOD Undocumented
Constant SINGLEDISPATCH_REGISTER_METHOD Undocumented
Constant SINGLEDISPATCH_TYPE Undocumented
Type Variable T Undocumented
Type Alias PluginContext Undocumented
def call_singledispatch_function_after_register_argument(ctx: MethodContext) -> Type: (source)

Called on the function after passing a type to register

def call_singledispatch_function_callback(ctx: MethodSigContext) -> FunctionLike: (source)

Called for functools._SingleDispatchCallable.__call__

def create_singledispatch_function_callback(ctx: FunctionContext) -> Type: (source)

Called for functools.singledispatch

def fail(ctx: PluginContext, msg: str, context: Context|None): (source)

Emit an error message. This tries to emit an error message at the location specified by `context`, falling back to the location specified by `ctx.context`. This is helpful when the only context information about where you want to put the error message may be None (like it is for `CallableType.definition`) and falling back to the location of the calling function is fine.

def get_dispatch_type(func: CallableType, register_arg: Type|None) -> Type|None: (source)

Undocumented

def get_first_arg(args: list[list[T]]) -> T|None: (source)

Get the element that corresponds to the first argument passed to the function

def get_singledispatch_info(typ: Instance) -> SingledispatchTypeVars|None: (source)

Undocumented

def make_fake_register_class_instance(api: CheckerPluginInterface, type_args: Sequence[Type]) -> Instance: (source)

Undocumented

def register_function(ctx: PluginContext, singledispatch_obj: Instance, func: Type, register_arg: Type|None = None): (source)

Register a function

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

Called for functools._SingleDispatchCallable.register

REGISTER_CALLABLE_CALL_METHOD = (source)

Undocumented

Value
f"""functools.{REGISTER_RETURN_CLASS}.__call__"""
REGISTER_RETURN_CLASS: str = (source)

Undocumented

Value
'_SingleDispatchRegisterCallable'
SINGLEDISPATCH_CALLABLE_CALL_METHOD = (source)

Undocumented

Value
f"""{SINGLEDISPATCH_TYPE}.__call__"""
SINGLEDISPATCH_REGISTER_METHOD = (source)

Undocumented

Value
f"""{SINGLEDISPATCH_TYPE}.register"""
SINGLEDISPATCH_TYPE: str = (source)

Undocumented

Value
'functools._SingleDispatchCallable'

Undocumented

Value
TypeVar('T')
PluginContext: _TypeAlias = (source)

Undocumented

Value
Union[FunctionContext, MethodContext]