[docs] [issue23406] interning and list comprehension leads to unexpected behavior

Martin Panter report at bugs.python.org
Fri Sep 4 13:48:46 CEST 2015


Martin Panter added the comment:

I was about to commit this, but I think I was wrong about one of my comments. The list that is multiplied is indeed shallow-copied. E.g. “[x] * 1” copies the list, but the reference to x is the same. I propose to commit the second patch, except to revert one of the sentences to the first patch, so it reads:

Note also that the copies are shallow; nested structures are not copied but referenced.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23406>
_______________________________________


More information about the docs mailing list