can someone explain why ..

Farshid Lashkari lashkariNO at SPAMworldviz.com
Tue Apr 25 19:48:35 EDT 2006


Schüle Daniel wrote:
> thx for quick reply :)
> 
> image is local variable of imageLabel
> I would expect that in case imageLabel lives, it should
> hold alife objects bound to its local variables
> 
> I am just curious *why* reference to image is not hold by imageLabel
> which on his part is hold by frame1 .. which is hold by global root

These are the only lines of code that reference "imageLabel":

imageLabel = Label(master = frame1, image = image)
imageLabel.pack()


Unless the constructor of Label adds a reference of itself to frame1, 
imageLabel will also become garbage collected at the end of the 
constructor. Are you sure this is the case?

-Farshid



More information about the Python-list mailing list