picop.cycellobject#

Closure cell helpers.

picop.cycellobject.cell_check(ob)#

Return True if ob is a cell object (PyCell_Check).

Parameters:

ob (object)

Return type:

bool

picop.cycellobject.cell_empty()#

Return a genuinely empty cell; unlike cell_new(None), contents access raises.

Return type:

object

picop.cycellobject.cell_eq(a, b)#

Return True if cell contents compare equal (not identity; empty↔empty True).

Parameters:
Return type:

bool

picop.cycellobject.cell_get(cell)#

Return the contents of cell (PyCell_GET); an empty cell raises ValueError.

Parameters:

cell (object)

Return type:

object

picop.cycellobject.cell_new(ob)#

Return a new cell containing ob (PyCell_New; ob may be None).

Parameters:

ob (object)

Return type:

object

picop.cycellobject.cell_set(cell, value)#

Set the contents of cell via PyCell_Set.

Notes

Returns 0 on success; errors raise — do not use the status as a bool.

Parameters:
Return type:

int

picop.cycellobject.cell_swap(cell, value)#

Replace contents; returns None when the cell was genuinely empty.

Parameters:
Return type:

object