[Python-ideas] clear() method for lists

Gerald Britton gerald.britton at gmail.com
Fri Feb 12 17:32:56 CET 2010


Thanks everyone.  Good to know!

On Fri, Feb 12, 2010 at 10:45 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Stephen J. Turnbull wrote:
>> This is covered in the manuals, but the gist is that every Python
>> object knows how many other objects are pointing to it (called a
>> refcount).  When an object's refcount drops to zero, it gets collected
>> (immediately, IIRC).
>
> This description applies for CPython (the one from python.org), since
> that uses refcounting with cyclic garbage collection. Other Python
> implementations work differently (e.g. Jython and IronPython rely on the
> garbage collector in their underlying VMs)
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> ---------------------------------------------------------------
>



-- 
Gerald Britton



More information about the Python-ideas mailing list