C-style static variables in Python?

John Nagle nagle at animats.com
Sun Apr 4 14:57:48 EDT 2010


kj wrote:
> When coding C I have often found static local variables useful for
> doing once-only run-time initializations. 

    If you want functions with state, use an object. That's what they're
for.  Don't muck with the internal representation of functions.

				John Nagle



More information about the Python-list mailing list