[Python-Dev] Declaring setters with getters (original) (raw)
Phillip J. Eby pje at telecommunity.com
Fri Nov 2 00:00:06 CET 2007
- Previous message: [Python-Dev] Declaring setters with getters
- Next message: [Python-Dev] Declaring setters with getters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 11:11 AM 11/2/2007 +1300, Greg Ewing wrote:
Raymond Hettinger wrote: > Let's stick with "propset" which has precedent as an svn action and > serves as a short, simple mnemonic to the functionality.
But if we're going to have "propset", it raises the question of why there isn't a "propget".
Which can be eliminated by having property.setter, especially in the form:
@property
def foo(self):
...
@foo.setter
def foo(self, value):
...
@foo.deleter
def foo(self):
...
This even preserves Guido's "read-only + read-write" use case, and saves us a builtin.
- Previous message: [Python-Dev] Declaring setters with getters
- Next message: [Python-Dev] Declaring setters with getters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]