Python advocacy in scientific computation

Alex Martelli aleaxit at yahoo.com
Sun Mar 5 19:38:54 EST 2006


Robert Kern <robert.kern at gmail.com> wrote:
   ...
> > just a toy. And as Matlab's run-time does reference counting insted of
> > proper garbage collection, any datastructure more complex than arrays
> > are sure to leak memory (I believe Python also suffered from this as
> > some point).
> 
> Python still uses reference counting and has several very good data structures
> more complex than arrays. And yet, most programs don't leak memory.

Python uses reference counting *AND* cyclic-garbage collection for the
kind of garbage that wouldn't go away by RC due to reference-cycles
(plus, also, weak references for yet another helper). To leak memory
despite all of that, you really need to do it on purpose (e.g. via a
C-coded container extension-type that does NOT play nice with gc;-).


Alex



More information about the Python-list mailing list