REPOST: Re: Properties fun with 2.2

Martin von Loewis loewis at
Thu Dec 27 01:20:02 CET 2001

"Mike C. Fletcher" <mcfletch at> writes:

> The "only defined properties" thing can be done with a __slots__ 
> definition in the object, but then there's no __dict__ in which to store 
> the data (there must be some way to say "store in the slot", I just 
> don't see it right now).

Delegating to a different attribute might be appropriate:

class X(object):
    __slots__ = ['_a']
    def set_a(self, val):
        self._a = val
    def get_a(self):
        return self._a
    a = property(get_a, set_a)


========= WAS CANCELLED BY =======:
From: Martin von Loewis <loewis at>
Newsgroups: comp.lang.python
Subject: cmsg cancel <j4d711h5u5.fsf at>
Control: cancel <j4d711h5u5.fsf at>
Date: Mon, 31 Dec 2001 03:15:49 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.j4d711h5u5.fsf at>
X-Trace: 1009776224 27193 (31 Dec 2001 05:23:44 GMT)
X-Complaints-To: usenet at
NNTP-Posting-Date: Mon, 31 Dec 2001 05:23:44 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.

More information about the Python-list mailing list