gherron at islandtraining.com
Mon Aug 11 21:47:02 CEST 2003
On Monday 11 August 2003 12:30 pm, Pablo Yabo wrote:
> I need to keep a object alive even if its reference count if zero.
> Is there any way to increment its reference count using Python code, not
> Py_INCREF or there is any way to avoid deletion of the object?
> Thanks, in advance
> Pablo Yabo
Sure. Just put the object into a list of things you want to keep
alive. The the reference count will not be zero and the object will
not be garbage collected.
KeepAlive =  # A global
and somwhere in your code:
More information about the Python-list