property using a classmethod
manu3d at gmail.com
Thu Jul 9 12:59:45 CEST 2009
today I did something like this:
myProperty = property(myClassMethod, None, None)
As many of you know this doesn't work and returns a TypeError: the
object passed to the property is not a callable function but a
classmethod object, which isn't callable at all. So, how do I do this?
Ultimately all I want is a non-callable class-level attribute
MyClass.myProperty that gives the result of MyClass.myClassMethod().
Can it be done?
More information about the Python-list