Georg Brandl <[EMAIL PROTECTED]> added the comment:

Yes, this is expected. Default values are only evaluated once, at
function creation time. If you need to have a mutable default argument
that is assigned to something and changed, use something like this:

def f(arg=None):
    if arg is None:
        arg = []
    ...

----------
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2561>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to