[issue23406] interning and list comprehension leads to unexpected behavior

Steven D'Aprano report at bugs.python.org
Sat Feb 7 14:20:24 CET 2015


Steven D'Aprano added the comment:

This is already a FAQ:

https://docs.python.org/2/faq/programming.html#how-do-i-create-a-multidimensional-list

I guess this bites every beginning Python programmer, but it's a natural, and desirable, consequence of Python's object model and the fact that * does not copy the list items.

----------
nosy: +steven.daprano
resolution:  -> not a bug

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


More information about the Python-bugs-list mailing list