Sick problem with Python properties
webmaster at t-dose.de
webmaster at t-dose.de
Thu Aug 7 07:52:16 EDT 2003
--On Donnerstag, 7. August 2003 4:45 Uhr -0700 Michael Chermside
<mcherm at mcherm.com> wrote:
> aj writes:
>> See the following code. I wonder why in this case neither
>> setp() nor getp() is called !?
> [... code ...]
>> pp = property(getp, setp)
> [... more code ...]
>> inst.p = 9
>> print inst.p
>
> Because you named it "pp", but then tried using "p" instead.
>
This was a bad cut&paste. The problem was that the class
must derive from object.....the heat :-)
-aj
More information about the Python-list
mailing list