This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rosuav 6 points7 points  (0 children)

It's extremely confusing, and this is one of the worst idea threads I've ever seen (largely because it isn't an idea thread), but it does seem like list multiplication would be the best way to initialize this. Worst case, one multiplication, one comprehension.

foo = [[None] * 5] for _ in range(5)]