Bug in python!? persistent value of an optional parameter in function!

Paul Rubin http
Wed Mar 7 22:24:38 EST 2007


John Nagle <nagle at animats.com> writes:
>     True.  It would make sense to disallow mutable values as
> initial values for optional arguments.  The present behavior is silly.

That would be the worst of both worlds.  The main alternative to the
present behavior is re-computing the default value every time the
function is entered.  



More information about the Python-list mailing list