New submission from antoine Zellmeyer: >>> tab = [['x']*3]*3 >>> tab [['x', 'x', 'x'], ['x', 'x', 'x'], ['x', 'x', 'x']] >>> tab[1][0] = 5 >>> tab [[5, 'x', 'x'], [5, 'x', 'x'], [5, 'x', 'x']] >>>
why not only the element tab[1][0] is changed ? ---------- assignee: terry.reedy components: IDLE, Interpreter Core, Macintosh messages: 271817 nosy: antoine Zellmeyer, ned.deily, ronaldoussoren, terry.reedy priority: normal severity: normal status: open title: list illogical affectation type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27668> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com