为什么删除超出屏幕的子弹中,要遍历所有bullets的副本?直接遍历删除超出屏幕元素后的bullets列表不行么?
def _update_bullets(self):
"""Update position of bullets and get rid of old bullets."""
# Update bullet positions.
self.bullets.update()
# Get rid of bullets that have disappeared.
for bullet in self.bullets.copy():
if bullet.rect.bottom <= 0:
self.bullets.remove(bullet)
```