[issue14707] extend() puzzled me.

2013-03-12 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg184008 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14707 ___

[issue14707] extend() puzzled me.

2013-03-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset c162e2ff15bd by Terry Jan Reedy in branch '2.7': Issue #14707: add news entry http://hg.python.org/cpython/rev/c162e2ff15bd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue14707] extend() puzzled me.

2012-05-03 Thread Daniel543
Daniel543 superplayer_...@163.com added the comment: Thank u both. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14707 ___ ___ Python-bugs-list

[issue14707] extend() puzzled me.

2012-05-02 Thread Daniel543
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']]

[issue14707] extend() puzzled me.

2012-05-02 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This is correct behavior, because: b[0] is c True (read up on the meaning of the is operator, if this is not a convincing proof to you). -- nosy: +loewis resolution: - invalid status: open - closed

[issue14707] extend() puzzled me.

2012-05-02 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: a = ['1'] b = [] c = a # now c and a refer to the same object b.append(a) # this object is appended to b a ['1'] b [['1']] c ['1'] # a and c refer to the same object you have in b # so all these ['1'] are actually the same object a =