In Python, if I multiply of list of objects by an integer, I get a list of references to that object, e.g.:
>>> a = [[]] * 3
>>> a
[[], [], []]
>>> a[0].append(1)
>>> a
[[1], [1], [1]]
If my desired behavior is to create a list of copies of the original object (e.g. copies created by the "copy.copy()" method or something sort of standard, is there an elegant way to do this with the same multiplication operator? Or should I just stick with a list comprehension or something? E.g.
[[] for x in range(0,3)]
Any version of Python is fine.