python中的一个引用的坑?
In [120]: l=[set()] * 10
In [121]: l[0] is l[1]
Out[121]: True
In [122]: l[0].add(1)
In [123]: l
Out[123]: [{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}]
In [120]: l=[set()] * 10
In [121]: l[0] is l[1]
Out[121]: True
In [122]: l[0].add(1)
In [123]: l
Out[123]: [{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}]