static keyword

Peter Hansen peter at engcorp.com
Thu Apr 29 15:49:48 EDT 2004


Nick Jacobson wrote:

> I don't know if "hack" is the right word.  What I meant is it seems
> like overkill to have to make (and name) a class, plus add a second
> function, every time you want a function to have a static variable.

I can't recall the last time I wanted a function to have
a static variable.  Years, it's been...

(That probably just says something about our approach to design
and coding.  I'm not criticizing you, just explaining why what
I showed seems natural and simple to mean, but not to you.)

-Peter



More information about the Python-list mailing list