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

Method c_undefined_value

mypyc/codegen/emit.py:379–388  ·  view source on GitHub ↗
(self, rtype: RType)

Source from the content-addressed store, hash-verified

377 self.emit_line(f"{target} = {self.c_undefined_value(rtype)};")
378
379 def c_undefined_value(self, rtype: RType) -> str:
380 if not rtype.is_unboxed:
381 return "NULL"
382 elif isinstance(rtype, RPrimitive):
383 return rtype.c_undefined
384 elif isinstance(rtype, RTuple):
385 return self.tuple_undefined_value(rtype)
386 elif isinstance(rtype, RVec):
387 return f"({self.ctype(rtype)}) {{ -1, NULL }}"
388 assert False, rtype
389
390 def c_error_value(self, rtype: RType) -> str:
391 return self.c_undefined_value(rtype)

Callers 10

set_undefined_valueMethod · 0.95
c_error_valueMethod · 0.95
emit_gc_clearMethod · 0.95
emit_reuse_clearMethod · 0.95
generate_arg_checkFunction · 0.45
emit_module_exec_funcMethod · 0.45
generate_setup_for_classFunction · 0.45

Calls 3

tuple_undefined_valueMethod · 0.95
ctypeMethod · 0.95
isinstanceFunction · 0.85