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

Method emit_arg_check

mypyc/codegen/emit.py:982–989  ·  view source on GitHub ↗
(self, src: str, dest: str, typ: RType, check: str, optional: bool)

Source from the content-addressed store, hash-verified

980 self.emit_label(out_label)
981
982 def emit_arg_check(self, src: str, dest: str, typ: RType, check: str, optional: bool) -> None:
983 if optional:
984 self.emit_line(f"if ({src} == NULL) {{")
985 self.emit_line(f"{dest} = {self.c_error_value(typ)};")
986 if check != "":
987 self.emit_line("{}if {}".format("} else " if optional else "", check))
988 elif optional:
989 self.emit_line("else {")
990
991 def emit_unbox(
992 self,

Callers 2

emit_castMethod · 0.95
emit_unboxMethod · 0.95

Calls 3

emit_lineMethod · 0.95
c_error_valueMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected