Deleting objects in Python 1.6

Michael Hudson mwh21 at cam.ac.uk
Wed May 3 11:10:47 EDT 2000


Alex <cut_me_out at hotmail.com> writes:

> Hi.  What does this mean?
> 
> > Deleting objects is safe even for deeply nested data structures. 
> 
> From python.org/1.6.

Try this:

>>> l=[[]]
>>> m=l[0]
>>> for i in range(100000):
...     m.append([])
...     m = m[0]
...
>>> del l

(hint: it segfaults on my machine, unless I use a v. new Python)

Cheers,
M

-- 
  There are 'infinite' number of developed artifacts and one cannot
  develop appreciation  for them all.  It would be all right to not
  understand something, but it would be imbecilic to put judgements
  on things one don't understand.              -- Xah, comp.lang.lisp



More information about the Python-list mailing list