mutable default arguments

Duncan Booth duncan at
Thu Feb 27 13:15:04 CET 2003

Arnaud Delobelle <delobelle at> wrote in 
news:87wujmx7ln.fsf at

> So my question is: what's the rationale behind it?  I've spent so much
> time working out what the problem was that I have no brainpower left,
> sorry.

See the FAQ, entry 6.25

Duncan Booth                                             duncan at
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

More information about the Python-list mailing list