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

Method test_unbox_int

mypyc/test/test_emitfunc.py:355–364  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

353 self.assert_emit(Box(self.n), """cpy_r_r0 = CPyTagged_StealAsObject(cpy_r_n);""")
354
355 def test_unbox_int(self) -> None:
356 self.assert_emit(
357 Unbox(self.m, int_rprimitive, 55),
358 """if (likely(PyLong_Check(cpy_r_m)))
359 cpy_r_r0 = CPyTagged_FromObject(cpy_r_m);
360 else {
361 CPy_TypeError("int", cpy_r_m); cpy_r_r0 = CPY_INT_TAG;
362 }
363 """,
364 )
365
366 def test_box_i64(self) -> None:
367 self.assert_emit(Box(self.i64), """cpy_r_r0 = PyLong_FromLongLong(cpy_r_i64);""")

Callers

nothing calls this directly

Calls 2

assert_emitMethod · 0.95
UnboxClass · 0.90

Tested by

no test coverage detected