# 不好的做法
coordinates_list = [(x, y) for x in range(1000) for y in range(1000)]
# 好的做法
coordinates_tuple = tuple((x, y) for x in range(1000) for y in range(1000))
频繁修改时用 list:
python
# 适合用 list
buffer = []
for item in data:
if process(item):
buffer.append(item)