property() type that only protects set?

Fernando Pérez fperez528 at yahoo.com
Tue Apr 9 18:07:08 EDT 2002


Brad Clements wrote:

> If you leave out fget (that is, let it default to None) then you have an
> attribute that cannot be read.
> 
> This isn't what I want.. I want an attr that can be read without a special
> getter function
> 
> (something like
> 
> myprop = property(self.__getattr,my_set)

Your request sounds reasonable enough to almost (IMHO) qualify as a bug report 
on mis-functionality of property(). It sounds to me reasonable to expect that 
un-specified property helpers would default to the normal behavior, instead 
of this all-or-none deal which seems to be the current behavior.

But I may be off-base on this one, I've only looked superficially at the 
issue.

Cheers,

f.



More information about the Python-list mailing list