/usr/share/doc/python2-docs/html/_sources/c-api
NameSizeModeActions
abstract.rst.txt7020644editdlrm
allocation.rst.txt47960644editdlrm
arg.rst.txt260040644editdlrm
bool.rst.txt13040644editdlrm
buffer.rst.txt229650644editdlrm
bytearray.rst.txt21810644editdlrm
capsule.rst.txt57410644editdlrm
cell.rst.txt19400644editdlrm
class.rst.txt18660644editdlrm
cobject.rst.txt18700644editdlrm
code.rst.txt16350644editdlrm
codec.rst.txt46430644editdlrm
complex.rst.txt40790644editdlrm
concrete.rst.txt19630644editdlrm
conversion.rst.txt70920644editdlrm
datetime.rst.txt64130644editdlrm
descriptor.rst.txt12960644editdlrm
dict.rst.txt77570644editdlrm
exceptions.rst.txt353040644editdlrm
file.rst.txt61980644editdlrm
float.rst.txt33710644editdlrm
function.rst.txt24210644editdlrm
gcsupport.rst.txt65870644editdlrm
gen.rst.txt9200644editdlrm
import.rst.txt112210644editdlrm
index.rst.txt5780644editdlrm
init.rst.txt491600644editdlrm
int.rst.txt45780644editdlrm
intro.rst.txt284730644editdlrm
iter.rst.txt13900644editdlrm
iterator.rst.txt17960644editdlrm
list.rst.txt63620644editdlrm
long.rst.txt79870644editdlrm
mapping.rst.txt28740644editdlrm
marshal.rst.txt39850644editdlrm
memory.rst.txt115560644editdlrm
method.rst.txt20990644editdlrm
module.rst.txt38670644editdlrm
none.rst.txt6970644editdlrm
number.rst.txt119390644editdlrm
objbuffer.rst.txt25160644editdlrm
object.rst.txt174910644editdlrm
objimpl.rst.txt3050644editdlrm
refcounting.rst.txt29340644editdlrm
reflection.rst.txt15670644editdlrm
sequence.rst.txt87160644editdlrm
set.rst.txt65880644editdlrm
slice.rst.txt29790644editdlrm
string.rst.txt154220644editdlrm
structures.rst.txt149660644editdlrm
sys.rst.txt57140644editdlrm
tuple.rst.txt54910644editdlrm
type.rst.txt27610644editdlrm
typeobj.rst.txt669360644editdlrm
unicode.rst.txt451260644editdlrm
utilities.rst.txt4150644editdlrm
veryhigh.rst.txt133630644editdlrm
weakref.rst.txt28200644editdlrm
Edit: /usr/share/doc/python2-docs/html/_sources/c-api/cell.rst.txt (1940B)
.. highlightlang:: c .. _cell-objects: Cell Objects ------------ "Cell" objects are used to implement variables referenced by multiple scopes. For each such variable, a cell object is created to store the value; the local variables of each stack frame that references the value contains a reference to the cells from outer scopes which also use that variable. When the value is accessed, the value contained in the cell is used instead of the cell object itself. This de-referencing of the cell object requires support from the generated byte-code; these are not automatically de-referenced when accessed. Cell objects are not likely to be useful elsewhere. .. c:type:: PyCellObject The C structure used for cell objects. .. c:var:: PyTypeObject PyCell_Type The type object corresponding to cell objects. .. c:function:: int PyCell_Check(ob) Return true if *ob* is a cell object; *ob* must not be *NULL*. .. c:function:: PyObject* PyCell_New(PyObject *ob) Create and return a new cell object containing the value *ob*. The parameter may be *NULL*. .. c:function:: PyObject* PyCell_Get(PyObject *cell) Return the contents of the cell *cell*. .. c:function:: PyObject* PyCell_GET(PyObject *cell) Return the contents of the cell *cell*, but without checking that *cell* is non-*NULL* and a cell object. .. c:function:: int PyCell_Set(PyObject *cell, PyObject *value) Set the contents of the cell object *cell* to *value*. This releases the reference to any current content of the cell. *value* may be *NULL*. *cell* must be non-*NULL*; if it is not a cell object, ``-1`` will be returned. On success, ``0`` will be returned. .. c:function:: void PyCell_SET(PyObject *cell, PyObject *value) Sets the value of the cell object *cell* to *value*. No reference counts are adjusted, and no checks are made for safety; *cell* must be non-*NULL* and must be a cell object.