Lines Matching refs:op
9 PyCellObject *op;
11 op = (PyCellObject *)PyObject_GC_New(PyCellObject, &PyCell_Type);
12 if (op == NULL)
14 op->ob_ref = obj;
17 _PyObject_GC_TRACK(op);
18 return (PyObject *)op;
53 PyCell_Get(PyObject *op)
55 if (!PyCell_Check(op)) {
59 Py_XINCREF(((PyCellObject*)op)->ob_ref);
60 return PyCell_GET(op);
64 PyCell_Set(PyObject *op, PyObject *obj)
67 if (!PyCell_Check(op)) {
71 oldobj = PyCell_GET(op);
73 PyCell_SET(op, obj);
79 cell_dealloc(PyCellObject *op)
81 _PyObject_GC_UNTRACK(op);
82 Py_XDECREF(op->ob_ref);
83 PyObject_GC_Del(op);
87 cell_richcompare(PyObject *a, PyObject *b, int op)
101 return PyObject_RichCompare(a, b, op);
103 Py_RETURN_RICHCOMPARE(b == NULL, a == NULL, op);
107 cell_repr(PyCellObject *op)
109 if (op->ob_ref == NULL)
110 return PyUnicode_FromFormat("<cell at %p: empty>", op);
113 op, Py_TYPE(op->ob_ref)->tp_name,
114 op->ob_ref);
118 cell_traverse(PyCellObject *op, visitproc visit, void *arg)
120 Py_VISIT(op->ob_ref);
125 cell_clear(PyCellObject *op)
127 Py_CLEAR(op->ob_ref);
132 cell_get_contents(PyCellObject *op, void *closure)
134 if (op->ob_ref == NULL)
139 Py_INCREF(op->ob_ref);
140 return op->ob_ref;
144 cell_set_contents(PyCellObject *op, PyObject *obj, void *Py_UNUSED(ignored))
147 Py_XSETREF(op->ob_ref, obj);