|
|
|
|
|
by AnkhMorporkian
3743 days ago
|
|
Additionally, generator comprehensions can be far more efficient than any simple for loop. If you had a generator with a billion star coordinates being read from some file, you'd never be able to load it all into memory. So, instead of manually making a generator function, you could just do coordinates = (star.x, star.y, star.z for star in star_map)
|
|