maximum recursion depth is reducing?

Xiao-Qin Xia xx758 at cam.ac.uk
Wed Feb 26 07:22:00 EST 2003


Dear Jp Calderone,
 
>   Not quite.  Everything in __init__ does not occur simultaneously.  Each
> line is executed before the line following it.  In the original code,
> 
>          def __init__(self, master):
>                  Frame.__init__(self,master)
>                  self.master = master
>                  self.pack()
>                  self.Text(self)

The method pack can be found since it is a method of Frame. At last I found 
that the problem lies in "self.Text(self)". If using "Text(self)" to 
generate a text widget, python will call self.__getattr__ for twice (to 
find "__nonzero__" and "__len__"), this is caused the problem.

Thanks,

Xiao-Qin




More information about the Python-list mailing list