del

Byron Morgan lazypointer at yahoo.com
Sat Feb 15 00:07:22 EST 2003


"Daniel Silva" <dsilva at ccs.neu.edu> wrote in message
news:b2jsir$csa$1 at camelot.ccs.neu.edu...
> What is the purpose of the del statement?  Why would you want to undefine
> a variable?  More precisely, how many programs would be broken if a python
> compiler did not implement it?
>
> - Daniel

I have an app that runs 20 hours each day, tracking trains that enter a
controlled territory. Throughout the day, as many as 900 objects of my train
class, each with a couple dozen attributes, are created, live for from 15 -
45 minutes while collecting and reporting data, then are destroyed (when
they leave the controlled territory). While I could choose to recycle the
train objects instead of deleting them, it would require additional
processing and housekeeping to do so.

Byron Morgan






More information about the Python-list mailing list