R. David Murray added the comment:
Both of these are FAQs, but to my surprise there don't seem to be answers to
them in the FAQ list. We should add some.
Yes, both of these behaviors is intentional. The first is an important part of
the language design: 'variable' names are just pointers to
New submission from Xiaoqing Rong:
I was using IDLE (Python GUI) for Python 3.3.3. I don't know if this is a bug
or you guys intend it to be this way:
>>> x=[1,2]
>>> y=x
>>> y.append(3)
>>> x
[1, 2, 3]
personally i'd prefer x stays as [1,2] when i'm trying to mutate y
also:
>>> def f1(m,n=['