Pythonic way to do static local variables?

Charles Krug cdkrug at worldnet.att.net
Mon Apr 25 21:10:18 EDT 2005


I've a function that needs to maintain an ordered sequence between
calls.

In C or C++, I'd declare the pointer (or collection object) static at
the function scope.

What's the Pythonic way to do this?

Is there a better solution than putting the sequence at module scope?

Thanks.






More information about the Python-list mailing list