Lines Matching refs:op
8 PyCellObject *op;
10 op = (PyCellObject *)PyObject_GC_New(PyCellObject, &PyCell_Type);
11 if (op == NULL)
13 op->ob_ref = obj;
16 _PyObject_GC_TRACK(op);
17 return (PyObject *)op;
21 PyCell_Get(PyObject *op)
23 if (!PyCell_Check(op)) {
27 Py_XINCREF(((PyCellObject*)op)->ob_ref);
28 return PyCell_GET(op);
32 PyCell_Set(PyObject *op, PyObject *obj)
35 if (!PyCell_Check(op)) {
39 oldobj = PyCell_GET(op);
41 PyCell_SET(op, obj);
47 cell_dealloc(PyCellObject *op)
49 _PyObject_GC_UNTRACK(op);
50 Py_XDECREF(op->ob_ref);
51 PyObject_GC_Del(op);
73 cell_repr(PyCellObject *op)
75 if (op->ob_ref == NULL)
76 return PyString_FromFormat("<cell at %p: empty>", op);
79 op, op->ob_ref->ob_type->tp_name,
80 op->ob_ref);
84 cell_traverse(PyCellObject *op, visitproc visit, void *arg)
86 Py_VISIT(op->ob_ref);
91 cell_clear(PyCellObject *op)
93 Py_CLEAR(op->ob_ref);
98 cell_get_contents(PyCellObject *op, void *closure)
100 if (op->ob_ref == NULL)
105 Py_INCREF(op->ob_ref);
106 return op->ob_ref;