Newbie asks about static variables...

Martijn Faassen faassen at pop.vet.uu.nl
Tue May 4 15:13:18 EDT 1999


Evan Simpson wrote:
> 
> If you *really*, *really* want a function-private static, you could write
> this:

[evil trick with default parameters]

> This is also a case study in the dangers of mutable default parameters.
> 
> I wouldn't normally mention a wierd idiom like this in the presence of a
> newbie, but I'm feeling evil.
> 
> with-a-stomach-flu-and-in-the-mood-to-spread-the-suffering-ly y'rs

These mutable default parameters are following me around lately;
everybody starts talking about them in threads I participate in, for
some reason. :)

Regards,

Martijn




More information about the Python-list mailing list