pre-PEP: Suite-Based Keywords

Leif K-Brooks eurleif at ecritters.biz
Fri Apr 15 21:30:14 EDT 2005


Brian Sabbey wrote:
> class C(object):
>    x = property():
>       doc = "I'm the 'x' property."
>       def fget(self):
>          return self.__x
>       def fset(self, value):
>          self.__x = value
>       def fdel(self):
>          del self.__x

After seeing this example, I think I'll go on a killing spree if your 
proposal doesn't get used in Python 2.5 or 2.6. Defining properties like 
that would be awesome, only better.



More information about the Python-list mailing list