Re: Do we need to delete "ImageDraw.Draw" after using it?

2006-09-21 Thread Fredrik Lundh
Steve Holden wrote: >> Is there any general rule that we must delete the object after using >> it? >> > Just consider it good hygiene. in this specific case, it may not be obvious for the casual reader that the global "draw" variable will contain an indirect reference to the original image obje

Re: Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread Steve Holden
Daniel Mark wrote: > Hello all: > > I am looking the sample code posted on PIL website > http://www.pythonware.com/library/pil/handbook/imagedraw.htm > > > <> > > import Image, ImageDraw > > im = Image.open("lena.pgm") > > draw = ImageDraw.Draw(

Re: Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread John Bokma
"Daniel Mark" <[EMAIL PROTECTED]> wrote: > Is there any general rule that we must delete the object after using > it? In general: if the object is not destroyed when it goes out of scope (but later) and uses precious resources [1], or if a special clean up is required, you should delete it expl

Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread Daniel Mark
Hello all: I am looking the sample code posted on PIL website http://www.pythonware.com/library/pil/handbook/imagedraw.htm <> import Image, ImageDraw im = Image.open("lena.pgm") draw = ImageDraw.Draw(im) draw.line((0, 0) + im.size, fill=128) dra