nmm1 at cus.cam.ac.uk
Wed Jun 28 18:40:32 CEST 2006
In article <mailman.7574.1151511089.27775.python-list at python.org>,
"Fredrik Lundh" <fredrik at pythonware.com> writes:
|> identical? you only applied @property to one of the methods, and then you're
|> surprised that only one of the methods were turned into a property?
I wasn't expecting EITHER to be turned INTO a property - I was expecting
both methods to be the same, but one would have non-default properties
attached to it.
|> @property turns your "joe" method into a getter method for the (virtual) attribute
|> "joe". when you access the attribute, the getter method will be called. whatever
|> that method returns will be the attribute's value.
Ah! That clarifies a lot.
|> that's what the documentation
|> says, and that's what your code is doing.
Er, no, it doesn't. What it says may well be COMPATIBLE with that, but
it is compatible with a good many other interpretations, too. Until and
unless you know what it means, you can't extract its meaning from its
More information about the Python-list