use of del() to delete a line

Hi everybody,

I have a question about the behavior of "del()" Python built-in.
In the following example, when I use del() on the copy of a line, it does
not delete it, whereas with the original line, it works. Why? I do not
understand, because the id is the same for the copy and the original:

···

#######################
from pylab import *
import Tkinter as Tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
ion()
root = Tk.Tk()
f = Figure( figsize = (8,7) )
veryplot = FigureCanvasTkAgg( f
      , master = root )
veryplot.get_tk_widget().pack( side = Tk.LEFT
      , expand = Tk.YES
      , fill = Tk.BOTH )
b = f.add_subplot( 211 )
t = arange(0.01, 5.0, 0.01)
s1 = sin(2*pi*t)
b.plot( t, s1 )
b.plot( t, s1+1 )
print b.lines
raw_input('press a key to delete a line with a copy')
line_copy = b.lines[-1]
print "original id=", id( b.lines[-1] ), "copy id", id( line_copy )
del( line_copy ) # or b.lines.pop()
b.figure.canvas.draw()
print b.lines
raw_input('press a key to delete a line directly')
print "original id=", id( b.lines[-1] )
del( b.lines[-1] ) # or b.lines.pop()
b.figure.canvas.draw()
print b.lines
raw_input('press a key to quit')
#######################

Thanks in advance,

Julien

--
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z
(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)