method to create class property

Alan Isaac aisaac at american.edu
Wed Mar 19 01:10:37 EDT 2008


Diez B. Roggisch wrote:

> In python 3.0, there will be an even nicer way - propset:



> @property 

> def foo(self):

>      return self._foo



> @propset 

> def foo(self, value):

>      self._value = value





Isn't that::



  @propset(foo)

  def foo(self, value):

      self._value = value



Cheers,

Alan Isaac





More information about the Python-list mailing list