Wow, THAT never happens in C!

Peter Hansen peter at engcorp.com
Mon Jun 28 15:26:43 CEST 2004


Kamilche wrote:

> I just discovered the debugging flags for the garbage collector. Since
> I have an insanely hierachical structure to my dataset, with
> references all OVER the place, I thought I'd turn it on to make sure I
> wasn't leaking.
> 
> Nothing happened. I searched the internet, and discovered how to
> 'force' a leak, so I tested with the single forced leak to see what
> would happen. It worked.
> 
> My code did NOT have any leaks in it! :-D That's almost a miraculous
> occurrence when programming in C.

It's also pretty much always going to be the case with Python,
unless you accidentally build code that defeats the garbage
collection scheme (ie. loops and __del__) or are in the habit of
writing code where items accumulate in lists and are never removed.

The only real leak I've ever found with Python was a bug in the
Python code itself (long since fixed, by the way, and in fact
fixed in a later version even before I found it in the version I
was using).

> I can't believe how much time I wasted trying to create my humongous
> project with C. :-(

You speak for many of us. :-)



More information about the Python-list mailing list