Re: [Python-ideas] The AttributeError/__getattr__ mechanism
29 Nov
2015
29 Nov
'15
10:10 a.m.
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.
3041
Age (days ago)
3042
Last active (days ago)
6 comments
4 participants
participants (4)
-
Andrew Barnert
-
Chris Angelico
-
Steven D'Aprano
-
王珺