Re: Class property (was: Class methods)

2005-10-14 Thread Bengt Richter
On Thu, 06 Oct 2005 11:05:10 +0200, Laszlo Zsolt Nagy <[EMAIL PROTECTED]> wrote: >Hughes, Chad O wrote: > >> Is there any way to create a class method? I can create a class >> variable like this: >> >Hmm, seeing this post, I have decided to implement a 'classproperty' >descriptor. >But I could

Re: Class property (was: Class methods)

2005-10-06 Thread Peter Otten
Laszlo Zsolt Nagy wrote: > I was trying for a while, but I could not implement a 'classproperty' > function. Is it possible at all? You could define a "normal" property in the metaclass: > class A: ... class __metaclass__(type): ... @property ... def clsprp(cls):

Class property (was: Class methods)

2005-10-06 Thread Laszlo Zsolt Nagy
Hughes, Chad O wrote: > Is there any way to create a class method? I can create a class > variable like this: > Hmm, seeing this post, I have decided to implement a 'classproperty' descriptor. But I could not. This is what I imagined: class A(object): _x = 0 @classmethod def get_x(