A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-November/075101.html below:

[Python-Dev] Declaring setters with getters

[Python-Dev] Declaring setters with getters [Python-Dev] Declaring setters with gettersGuido van Rossum guido at python.org
Fri Nov 2 01:39:34 CET 2007
On 11/1/07, Phillip J. Eby <pje at 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/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4