maximum recursion depth is reducing?

Steven Taschuk staschuk at telusplanet.net
Tue Feb 25 12:48:07 EST 2003


Quoth Xiao-Qin Xia:
  [...]
> ****Question 1****:
  [...]
> Does that mean the maximum recursion depth is reducing from 19987 
> (Python1.5.2) to 1987(Python2.1-2.2) to less (Python2.3a)?

Dunno; I'll have to leave this one for someone else.

> ****Question 2****:
  [...]
> Does this mean Python will allways call __getattr__ when call a method, but 
> not call __getattr__ when citing a local attribute variable?

See the Language Reference, section 3.3.2 (Customizing attribute
access):
    __getattr__(self, name)
        Called when an attribute lookup has not found the attribute in the
        usual places (i.e. it is not an instance attribute nor is it found
        in the class tree for self). [...]

So if self.text_widget has been bound, a reference to it will be
resolved normally, and __getattr__ will not be called.

-- 
Steven Taschuk                               staschuk at telusplanet.net
"What I find most baffling about that song is that it was not a hit."
                            -- Tony Dylan Davis (CKUA)





More information about the Python-list mailing list