[Python-Dev] Cycle collection enhancement idea (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Sun Jun 29 20:15:07 CEST 2008


Additionally, there is another problem: If the cycle is not temporarily revived, and you call del manually, it may break the cycle by removing the references. Thus, objects in the cycle will go down to refcount=0 during your attempt to call del's on the objects in the cycle. The only sane thing is to temporarily revive the entire cycle so you can safely call del's on it. Then, you might want to disable the normal del calling that occurs as part of the later destruction of the cycle.

I still don't understand what "revive the cycle" means. You will need to incref the object for which you call del, that's all.

Regards, Martin



More information about the Python-Dev mailing list