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

Method test_get_attr

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

Source from the content-addressed store, hash-verified

466 )
467
468 def test_get_attr(self) -> None:
469 self.assert_emit(
470 GetAttr(self.r, "y", 1),
471 """cpy_r_r0 = ((mod___AObject *)cpy_r_r)->_y;
472 if (unlikely(cpy_r_r0 == CPY_INT_TAG)) {
473 PyErr_SetString(PyExc_AttributeError, "attribute 'y' of 'A' undefined");
474 } else {
475 CPyTagged_INCREF(cpy_r_r0);
476 }
477 """,
478 )
479
480 def test_get_attr_non_refcounted(self) -> None:
481 self.assert_emit(

Callers

nothing calls this directly

Calls 2

assert_emitMethod · 0.95
GetAttrClass · 0.90

Tested by

no test coverage detected