Giampaolo Rodola' <[email protected]> added the comment:
I think the problem relies in here:
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
def __getattr__(self, attr):
return getattr(self.socket, attr)
I wonder why this has been added in the first place.
It also causes confusing error messages when accessing undefined attributes:
>>> class B(asyncore.dispatcher):
... def __init__(self, *args):
... asyncore.dispatcher.__init__(self, *args)
...
>>> b = B()
>>> b.blabla
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/asyncore.py", line 394, in __getattr__
return getattr(self.socket, attr)
AttributeError: '_socketobject' object has no attribute 'blabla'
>>>
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8483>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com