New submission from Yan: Is this the correct behavior?
>>> l=[['']*2]*3 >>> b=[['', ''], ['', ''], ['', '']] >>> l == b True >>> l[0][1]='A' >>> b[0][1]='A' >>> l == b False >>> l [['', 'A'], ['', 'A'], ['', 'A']] >>> b [['', 'A'], ['', ''], ['', '']] ---------- messages: 254978 nosy: ydu priority: normal severity: normal status: open title: Assignment of one element in nested list changes multiple elements type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25681> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com