Lazy Attribute
Rouslan Korneychuk
rouslank at msn.com
Fri Nov 16 04:32:08 EST 2012
On 11/16/2012 02:49 AM, Andriy Kornatskyy wrote:
>> If accessing the descriptor on the class object has no special
>> meaning, then the custom is to return the descriptor object itself, as
>> properties do.
>
> If I would satisfy this, I will be forced to check for None 99.9% of the use cases (it is not None, being applied to an object). Thus it behaves as designed.
That's not true. You can use a try-except block to return the descriptor
object when an AttributeError is raised.
More information about the Python-list
mailing list