class documentation

class MethodAdder: (source)

View In Hierarchy

Helper to add methods to a TypeInfo.

ctx: The ClassDefCtx we are using on which we will add methods.

Method __init__ Undocumented
Method add​_method Add a method: def <method_name>(self, <args>) -> <ret_type>): ... to info.
Instance Variable ctx Undocumented
Instance Variable self​_type Undocumented
def __init__(self, ctx): (source)

Undocumented

Parameters
ctx:mypy.plugin.ClassDefContextUndocumented
def add_method(self, method_name, args, ret_type, self_type=None, tvd=None): (source)

Add a method: def <method_name>(self, <args>) -> <ret_type>): ... to info.

self_type: The type to use for the self argument or None to use the inferred self type. tvd: If the method is generic these should be the type variables.

Parameters
method​_name:strUndocumented
args:List[Argument]Undocumented
ret​_type:TypeUndocumented
self​_type:Optional[Type]Undocumented
tvd:Optional[TypeVarType]Undocumented

Undocumented

self_type = (source)

Undocumented