On 31.05.2016 07:27, Matthew Tanous wrote:
arr = [[True] * 5] * 5
This does not create a matrix-like arrangement of the immutable truth variable, but instead creates a list of 5 references to the same list
I think this would be better addressed by an extension to list comprehensions, e.g.
arr = [[True times 5] times 5]
[x times n]
would be equivalent to
[x for i in range(n)]
Since this would evaluate x afresh for each elment, it would avoid all the thorny issues involved in trying to automatically deep-copy arbitrary objects.