[issue6730] dict.fromkeys() should not cross reference mutable value by default
report at bugs.python.org
Tue Aug 18 22:53:02 CEST 2009
Maxime Lemonnier <maxime.lemonnier at gmail.com> added the comment:
It does not suits my needs.
what if keys are passed as an argument?
I have to add this ugly loop :
for key in keys:
d[key] = 
I really think that :
1) The doc should warn about it, since it is a very weird behaviour
2) There could at least be a third argument allowing the user to choose,
with a default value that maintains the current behaviour (for
compatibility, even though I think the default should be a deep copy)
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list