what is the difference between @property and method
jeanpierreda at gmail.com
Thu Feb 9 10:05:06 CET 2012
On Thu, Feb 9, 2012 at 3:50 AM, Zheng Li <dllizheng at gmail.com> wrote:
> class A(object):
> def value1(self):
> return 'value1'
> def value2(self):
> return 'value2'
> what is the difference between value1 and value2.
There is no such thing as @properymethod
After you change the code to use @property, try writing it in the
interactive interpreter and calling A().value2(). Then try calling
Or maybe try googling for it. The fourth result for "property python"
for me is http://adam.gomaa.us/blog/2008/aug/11/the-python-property-builtin/
It is kind of funny that the docs don't ever explicitly say what a
property is. http://docs.python.org/library/functions.html#property
More information about the Python-list