[issue1615] descriptor protocol bug

Micah Friesen report at bugs.python.org
Tue Apr 17 18:16:30 CEST 2012


Micah Friesen <guinnessforbreakfast at gmail.com> added the comment:

I ran into this recently, as well, and have lost probably a day's worth of time debugging it. I submit that this is not a feature - I can't imagine a real-world scenario where you actually want to write debuggable code where a descriptor defers to __getattr__ (except perhaps for exception handling, in which case some re-factoring is in order), particularly because descriptors are effectively mix-ins and can be used on multiple classes.

I worked around this by writing an ancestor descriptor that catches AttributeErrors and re-raises them as a user-defined exception.

----------
nosy: +Micah.Friesen

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1615>
_______________________________________


More information about the Python-bugs-list mailing list