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/075183.html below:

[Python-Dev] Declaring setters with getters

[Python-Dev] Declaring setters with getters [Python-Dev] Declaring setters with gettersSteven Bethard steven.bethard at gmail.com
Sat Nov 10 20:09:16 CET 2007
On Nov 10, 2007 11:31 AM, Guido van Rossum <guido at python.org> wrote:
> Unless I get negative feedback really soon I plan to submit this later
> today. I've tweaked the patch slightly to be smarter about replacing
> the setter and the deleter together if they are the same object.

Definitely +1 on the basic patch.

Could you explain briefly the advantage of the "hack" that merges the
set and del methods?  Looking at the patch, I get a little nervous
about this::

        @foo.setter
        def foo(self, value=None):
            if value is None:
                del self._foo
            else:
                self._foo = abs(value)

That means that ``c.foo = None`` is equivalent to ``del c.foo`` right?

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy
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