[issue35515] Matrix operator star creates a false matrix

Christian Heimes report at bugs.python.org
Mon Dec 17 04:09:23 EST 2018


Christian Heimes <lists at cheimes.de> added the comment:

[[0,0]]*4 is not a matrix definition. You are defining a list that shares the same list object four times. It's a common misunderstanding how list works, see https://stackoverflow.com/questions/240178/list-of-lists-changes-reflected-across-sublists-unexpectedly

----------
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35515>
_______________________________________


More information about the Python-bugs-list mailing list