New submission from Daniel543 <superplayer_...@163.com>:

Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = ['1']
>>> b = []
>>> c = a
>>> b.append(a)
>>> a
['1']
>>> b
[['1']]
>>> c
['1']
>>> a = ['2']
>>> c.extend(a)
>>> b
[['1', '2']]
>>> c
['1', '2']
>>> a
['2']
>>> 

Is this wrong? I think the "b" should not change.

----------
components: None
messages: 159807
nosy: Daniel543
priority: normal
severity: normal
status: open
title: extend() puzzled me.
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14707>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to