Why is creating a list comprehension faster?
2019-11-18
Yesterday, I was removing a list-comprehension as an argument to sum. This is the diff:
- sum([p.price for p in self.products])
+ sum(p.price for p in self.products)
To show the original programmer my line of though I performed a little experiment with the following message and …