In article <[EMAIL PROTECTED]>, Thomas Rast <[EMAIL PROTECTED]> wrote: > >I've found out about a fundamental problem of attribute lookup, the >hard way.
Maybe. >asyncore.py uses the following code: > >class dispatcher: > # ... > def __getattr__(self, attr): > return getattr(self.socket, attr) > >Now suppose that I'm asking for some attribute not provided by >dispatcher: The lookup mechanism will apparently try to find it >directly and fail, generating an AttributeError; next it will call >__getattr__ to find the attribute. So far, no problems. > >But I used a property much like this: > >>>> import asyncore >>>> class Peer(asyncore.dispatcher): >... def _get_foo(self): >... # caused by a bug, several stack levels deeper >... raise AttributeError('hidden!') >... foo = property(_get_foo) >... You're not supposed to use properties with classic classes. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "19. A language that doesn't affect the way you think about programming, is not worth knowing." --Alan Perlis -- http://mail.python.org/mailman/listinfo/python-list