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
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):
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(