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

Function translate_bool

mypyc/irbuild/specialize.py:1172–1177  ·  view source on GitHub ↗
(builder: IRBuilder, expr: CallExpr, callee: RefExpr)

Source from the content-addressed store, hash-verified

1170
1171@specialize_function("builtins.bool")
1172def translate_bool(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Value | None:
1173 if len(expr.args) != 1 or expr.arg_kinds[0] != ARG_POS:
1174 return None
1175 arg = expr.args[0]
1176 src = builder.accept(arg)
1177 return builder.builder.bool_value(src)
1178
1179
1180@specialize_function("builtins.float")

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
bool_valueMethod · 0.80
acceptMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…