Re: Destructor Woes, was Advice needed on __del__

2005-05-12 Thread flupke
Fredrik Lundh wrote: > "flupke" wrote: > > >>>Then i got a tip that you can register a function that needs to be >>>called when the object is going to be deleted. >>>For instance to register a function __exit, you do this: > > >>>class line: >>>def __init__(s,glob,argl,color=''): >>>

Re: Destructor Woes, was Advice needed on __del__

2005-05-12 Thread phil
> > do you (or whoever gave you the tip) have the slightest idea what atexit does? > Yeah, I got the tip on this group. researched and found it was for when program ends! I was trying to treat it like a destructor. darn. -- http://mail.python.org/mailman/listinfo/python-list

Re: Destructor Woes, was Advice needed on __del__

2005-05-12 Thread Fredrik Lundh
"phil" <[EMAIL PROTECTED]> wrote: >> Then i got a tip that you can register a function that needs to be >> called when the object is going to be deleted. >> For instance to register a function __exit, you do this: > > Here is the complete line class with your suggestion: > > Below is the output. >

Re: Destructor Woes, was Advice needed on __del__

2005-05-12 Thread Fredrik Lundh
"flupke" wrote: >> Then i got a tip that you can register a function that needs to be >> called when the object is going to be deleted. >> For instance to register a function __exit, you do this: >> class line: >> def __init__(s,glob,argl,color=''): >> atexit.register(s.__exit) > I d

Re: Destructor Woes, was Advice needed on __del__

2005-05-12 Thread flupke
phil wrote: > >> Then i got a tip that you can register a function that needs to be >> called when the object is going to be deleted. >> For instance to register a function __exit, you do this: >> > > > Here is the complete line class with your suggestion: > > Below is the output. > > Nice id

Destructor Woes, was Advice needed on __del__

2005-05-10 Thread phil
> Then i got a tip that you can register a function that needs to be > called when the object is going to be deleted. > For instance to register a function __exit, you do this: > Here is the complete line class with your suggestion: Below is the output. Nice idea, maybe I did something wrong