MCPcopy Create free account
hub / github.com/python/mypy / add_local_reg

Method add_local_reg

mypyc/irbuild/builder.py:1454–1461  ·  view source on GitHub ↗

Like add_local, but return an assignment target instead of value.

(
        self, symbol: SymbolNode, typ: RType, is_arg: bool = False
    )

Source from the content-addressed store, hash-verified

1452 return reg
1453
1454 def add_local_reg(
1455 self, symbol: SymbolNode, typ: RType, is_arg: bool = False
1456 ) -> AssignmentTargetRegister:
1457 """Like add_local, but return an assignment target instead of value."""
1458 self.add_local(symbol, typ, is_arg)
1459 target = self.symtables[-1][symbol]
1460 assert isinstance(target, AssignmentTargetRegister), target
1461 return target
1462
1463 def add_self_to_env(self, cls: ClassIR) -> AssignmentTargetRegister:
1464 """Low-level function that adds a 'self' argument.

Callers 6

get_assignment_targetMethod · 0.95
add_self_to_envMethod · 0.95
get_argsFunction · 0.80
get_func_targetFunction · 0.80
add_args_to_envFunction · 0.80

Calls 2

add_localMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected