[Python-Dev] Extended Function syntax

Just van Rossum just@letterror.com
Tue, 28 Jan 2003 12:22:44 +0100


Walter D=F6rwald wrote:

> class Foo(object):
>      property myprop:
>          """A computed property on Foo objects."""
>=20
>          def __get__(self):
>              return ...
>          def __set__(self):
>              ...
>          def __delete__(self):
>              ...
>=20

With MWH's patch, this could be:

class Foo(object):
     class myprop [property]:
         """A computed property on Foo objects."""

         def __get__(self):
             return ...
         def __set__(self):
             ...
         def __delete__(self):
             ...

(with a different definition of property(), though...)

Just