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

Function add_setter_declaration

mypyc/irbuild/prepare.py:644–654  ·  view source on GitHub ↗
(
    ir: ClassIR, attr_name: str, attr_rtype: RType, module_name: str
)

Source from the content-addressed store, hash-verified

642
643
644def add_setter_declaration(
645 ir: ClassIR, attr_name: str, attr_rtype: RType, module_name: str
646) -> None:
647 self_arg = RuntimeArg("self", RInstance(ir), pos_only=True)
648 value_arg = RuntimeArg("value", attr_rtype, pos_only=True)
649 sig = FuncSignature([self_arg, value_arg], none_rprimitive)
650 setter_name = PROPSET_PREFIX + attr_name
651 decl = FuncDecl(setter_name, ir.name, module_name, sig, FUNC_NORMAL)
652 decl.is_prop_setter = True
653 decl.implicit = True # Triggers synthesization
654 ir.method_decls[setter_name] = decl
655
656
657def check_matching_args(init_sig: FuncSignature, new_sig: FuncSignature) -> bool:

Calls 4

RuntimeArgClass · 0.90
RInstanceClass · 0.90
FuncSignatureClass · 0.90
FuncDeclClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…