[Python-Dev] Descriptor API
Phillip J. Eby
pje@telecommunity.com
Wed, 21 May 2003 07:52:53 -0400
At 01:41 AM 5/21/03 +0100, Gonçalo Rodrigues wrote:
>So, why doesn't getting __set__ raise AttributeError in the above case?
Because property() is a type. And that type has __get__ and __set__ methods.
>Is this a bug?
No.
>If it's not, it sure is a (minor) feature request from my
>part :-)
To do this would require there to be two types, and 'property()' be a
function that selected which of the two types to instantiate.
Why do you care whether the attribute is read-only? Are you writing a
documentation tool?