[Python-ideas] The AttributeError/__getattr__ mechanism

王珺 wjun77 at gmail.com
Sun Nov 29 13:10:12 EST 2015


> A dedicated subclass of *Attr*ibuteError to trigger __get*attr*__ is more
natural.
I mean it's unnatural to convert AttributeError to AttributeDynamicError by
property or descriptor. Why not use RuntimeError as that of PEP479?

And there's no need to write custom property-like descriptor factory when
you want to trigger __getattr__, although it may be only a few lines of
code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151130/a5f783cb/attachment.html>


More information about the Python-ideas mailing list