[EMAIL PROTECTED] wrote: > hi > i have define a class like this > # class A: class A(object): > _var1 = 0 > def __init__(self): > ## some initialization > self.func1() > # def func1(): def func1(self): > ..... # _var1 = 1 self.__class__._var1 = 1 # or if func1() does'nt use any instance attributes: # @classmethod # def func1(cls): # .... # cls._var1 = 1
> def getvarValue(self): # return _var1 return self.__class__._var1 > I wanted var1 to be "global" inside Class A. The name is "class attribute". -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list