class documentation
class MethodAdder: (source)
Helper to add methods to a TypeInfo. ctx: The ClassDefCtx we are using on which we will add methods.
Method | __init__ |
Undocumented |
Method | add |
Add a method: def <method_name>(self, <args>) -> <ret_type>): ... to info. |
Instance Variable | ctx |
Undocumented |
Instance Variable | self |
Undocumented |
def add_method(self, method_name:
str
, args: list[ Argument]
, ret_type: Type
, self_type: Type|None
= None, tvd: TypeVarType|None
= 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.