• Home
  • Raw
  • Download

Lines Matching refs:ag

1153     attrgetterobject *ag;  in attrgetter_new()  local
1250 ag = PyObject_GC_New(attrgetterobject, (PyTypeObject *)state->attrgetter_type); in attrgetter_new()
1251 if (ag == NULL) { in attrgetter_new()
1256 ag->attr = attr; in attrgetter_new()
1257 ag->nattrs = nattrs; in attrgetter_new()
1259 PyObject_GC_Track(ag); in attrgetter_new()
1260 return (PyObject *)ag; in attrgetter_new()
1264 attrgetter_clear(attrgetterobject *ag) in attrgetter_clear() argument
1266 Py_CLEAR(ag->attr); in attrgetter_clear()
1271 attrgetter_dealloc(attrgetterobject *ag) in attrgetter_dealloc() argument
1273 PyTypeObject *tp = Py_TYPE(ag); in attrgetter_dealloc()
1274 PyObject_GC_UnTrack(ag); in attrgetter_dealloc()
1275 (void)attrgetter_clear(ag); in attrgetter_dealloc()
1276 tp->tp_free(ag); in attrgetter_dealloc()
1281 attrgetter_traverse(attrgetterobject *ag, visitproc visit, void *arg) in attrgetter_traverse() argument
1283 Py_VISIT(ag->attr); in attrgetter_traverse()
1284 Py_VISIT(Py_TYPE(ag)); in attrgetter_traverse()
1322 attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw) in attrgetter_call() argument
1325 Py_ssize_t i, nattrs=ag->nattrs; in attrgetter_call()
1332 if (ag->nattrs == 1) /* ag->attr is always a tuple */ in attrgetter_call()
1333 return dotted_getattr(obj, PyTuple_GET_ITEM(ag->attr, 0)); in attrgetter_call()
1335 assert(PyTuple_Check(ag->attr)); in attrgetter_call()
1336 assert(PyTuple_GET_SIZE(ag->attr) == nattrs); in attrgetter_call()
1344 attr = PyTuple_GET_ITEM(ag->attr, i); in attrgetter_call()
1372 attrgetter_args(attrgetterobject *ag) in attrgetter_args() argument
1376 PyObject *attrstrings = PyTuple_New(ag->nattrs); in attrgetter_args()
1380 for (i = 0; i < ag->nattrs; ++i) { in attrgetter_args()
1381 PyObject *attr = PyTuple_GET_ITEM(ag->attr, i); in attrgetter_args()
1395 attrgetter_repr(attrgetterobject *ag) in attrgetter_repr() argument
1398 int status = Py_ReprEnter((PyObject *)ag); in attrgetter_repr()
1402 return PyUnicode_FromFormat("%s(...)", Py_TYPE(ag)->tp_name); in attrgetter_repr()
1405 if (ag->nattrs == 1) { in attrgetter_repr()
1407 PyObject *attr = dotjoinattr(PyTuple_GET_ITEM(ag->attr, 0), &attrsep); in attrgetter_repr()
1409 repr = PyUnicode_FromFormat("%s(%R)", Py_TYPE(ag)->tp_name, attr); in attrgetter_repr()
1415 PyObject *attrstrings = attrgetter_args(ag); in attrgetter_repr()
1418 Py_TYPE(ag)->tp_name, attrstrings); in attrgetter_repr()
1422 Py_ReprLeave((PyObject *)ag); in attrgetter_repr()
1427 attrgetter_reduce(attrgetterobject *ag, PyObject *Py_UNUSED(ignored)) in attrgetter_reduce() argument
1429 PyObject *attrstrings = attrgetter_args(ag); in attrgetter_reduce()
1433 return Py_BuildValue("ON", Py_TYPE(ag), attrstrings); in attrgetter_reduce()