Bruno Desthuilliers wrote: > Lie Ryan a écrit : >> Emanuele D'Arrigo wrote: > (snip) >>> Ultimately all I want is a non-callable class-level attribute >>> MyClass.myProperty that gives the result of MyClass.myClassMethod(). >> >> This works like what you seem to want (it's ugly): > > Ugly, indeed. And an extreme case of arbitrary overcomplexification too :-/ > > (snip rube goldberg code) >
Can't think of anything simpler than that without meddling with descriptor. I'm not even sure descriptor can help here as it seems descriptor needs an instance? (I've just skimmed it, so I may be wrong) The ugliness of the code hints to two possible reasons: - there should be a better way - if there isn't an easier way, then something is wrong the class' design -- http://mail.python.org/mailman/listinfo/python-list