Emanuel Barry added the comment: To add to what SilentGhost just said; the '*' operator for lists doesn't create new lists, but simply creates new references to the same list (i.e. it doesn't re-evaluate the expression).
To create separate lists, you can do a list comprehension such as: [['x'] * 3 for _ in range(3)] More information is available on the FAQ: https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x ---------- assignee: terry.reedy -> nosy: +ebarry _______________________________________ 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