mutable default parameter problem [Prothon]
dave at pythonapocrypha.com
Fri Jun 25 22:45:48 CEST 2004
> > Seems like a waste to reserve a
> > symbol for something so rarely needed.
> Lisp and Scheme do the same thing:
> (set! a 5) <- sets a variable (i.e. changes its value)
> (eq? a 6) <- tests equality (returns true or false)
> It's defined precisely because it's not needed often (at least in the !
> case): the functions that modify their arguments are few and far between,
> so it is best to warn the programmer of this behaviour.
An apples-to-oranges comparison, IMO - it makes sense to delimit a side
effect in a functional language.
More information about the Python-list