Re: [Python-Dev] Declaring setters with getters
I'm not sure about the name "propset" ... Maybe something like "setproperty" would be better.
I think not. Saying "setproperty" has too many ambiguous mental parsings. When does "set" take place -- assigning a value to a property is different defining the property itself. Is "set" a verb so that we're talking about a property of sets/frozensets. Is "set" a completed action so that the property has been set. Let's stick with "propset" which has precedent as an svn action and serves as a short, simple mnemonic to the functionality. Also, I find that these unique words are easier to search for. I once co-owned a magazine called Know Your Boston and it was very difficult for clients to find using Google. Raymond
"Raymond Hettinger" <python@rcn.com> wrote in message news:20071031194505.AAO44984@ms19.lnh.mail.rcn.net... |> I'm not sure about the name "propset" ... | >Maybe something like "setproperty" would be better. | | I think not. Saying "setproperty" has too many ambiguous mental parsings. When does "set" take place -- assigning a value to a property is different defining the property itself. Is "set" a verb so that we're talking about a property of sets/frozensets. Is "set" a completed action so that the property has been set. | | Let's stick with "propset" which has precedent as an svn action and serves as a short, simple mnemonic to the functionality. | | Also, I find that these unique words are easier to search for. I once co-owned a magazine called Know Your Boston and it was very difficult for clients to find using Google. 'propset' would have the virtue of following 'property' in the alpha listing of functions in the manual.
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". -- Greg
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.
On 11/1/07, Phillip J. Eby <pje@telecommunity.com> wrote:
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.
Although it begs the question what happened to @foo.getter. I'm only +0 on this -- I can't quite pinpoint what's wrong with it but it doesn't fell 100% right. Maybe I just need to sleep on it. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (5)
-
Greg Ewing
-
Guido van Rossum
-
Phillip J. Eby
-
Raymond Hettinger
-
Terry Reedy