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

Method error_value_check

mypyc/codegen/emit.py:502–514  ·  view source on GitHub ↗
(self, rtype: RType, value: str, compare: str)

Source from the content-addressed store, hash-verified

500 self.emit_line(f"if ({check}) {{")
501
502 def error_value_check(self, rtype: RType, value: str, compare: str) -> str:
503 if isinstance(rtype, RTuple):
504 return self.tuple_undefined_check_cond(
505 rtype, value, self.c_error_value, compare, check_exception=False
506 )
507 elif isinstance(rtype, RVec):
508 if compare == "==":
509 return f"{value}.len < 0"
510 elif compare == "!=":
511 return f"{value}.len >= 0"
512 assert False, compare
513 else:
514 return f"{value} {compare} {self.c_error_value(rtype)}"
515
516 def tuple_undefined_check_cond(
517 self,

Callers 2

Calls 3

c_error_valueMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected