On Mon, 2005-10-17 at 21:55, Guido van Rossum wrote:

> Let's change the property built-in so that its arguments can be either
> functions or strings (or None). If they are functions or None, it
> behaves exactly like it always has.
> 
> If an argument is a string, it should be a method name, and the method
> is looked up by that name each time the property is used. Because this
> is late binding, it can be put before the method definitions, and a
> subclass can override the methods. Example:
> 
> class C:
> 
>     foo = property('getFoo', 'setFoo', None, 'the foo property')
> 
>     def getFoo(self):
>         return self._foo
> 
>     def setFoo(self, foo):
>         self._foo = foo
> 
> What do you think?

Ick, for all the reasons that strings are less appealing than names. 
IMO, there's not enough advantage in having the property() call before
the functions than after.

-Barry

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to