This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nobody
Recipients
Date 2001-04-18.05:29:22
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
-- Python 2.0 Win32 --

It seems to be that _default argument values_ can be 
changed permanently if they are dictionaries.

Code sample:

def f(a = 1):
  print a
  a = 2

>>>f()
1
>>>f()
1

--> ok

def g(mydic = {}):
  print mydic
  mydic["test"] = 1

>>>g()
{}
>>>g()
{'test': 1}

--> bad (default argument value for 'mydic' changed)
History
Date User Action Args
2007-08-23 13:53:55adminlinkissue416951 messages
2007-08-23 13:53:55admincreate