static information...

Larry Bates lbates at
Mon Mar 22 23:49:10 CET 2004

Try A.static.extend([1,2,3]) and see what that
give you.

Larry Bates

<niurka.perez at> wrote in message
news:mailman.253.1079991337.742.python-list at
> I've been looking for a way of have static variables in a python class and
all I
> have found is this:
>  class A:
>             static =[]
>             def f(self):
>                         A.static = [1,2,3]
> That seems to be pretty static since that variable can be used either on
> class (such as A.static) or on an instance (such as A().static).
> Now my problem is that every time some create a new instance of this class
> variable static is reset to its original value [] and the real value that
> took is lost. What I want is someplace to store class's information and
> instance's information.
> Any idea?

More information about the Python-list mailing list