MCPcopy Index your code
hub / github.com/python/mypy / add_function

Method add_function

mypyc/irbuild/builder.py:1580–1586  ·  view source on GitHub ↗
(self, func_ir: FuncIR, line: int)

Source from the content-addressed store, hash-verified

1578 self.errors.note(msg, self.module_path, line)
1579
1580 def add_function(self, func_ir: FuncIR, line: int) -> None:
1581 name = (func_ir.class_name, func_ir.name)
1582 if name in self.function_names:
1583 self.error(f'Duplicate definition of "{name[1]}" not supported by mypyc', line)
1584 return
1585 self.function_names.add(name)
1586 self.functions.append(func_ir)
1587
1588 def get_current_class_ir(self) -> ClassIR | None:
1589 type_info = self.fn_info.fitem.info

Callers 1

transform_func_defFunction · 0.80

Calls 3

errorMethod · 0.95
appendMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected