3 ms·
> It makes the point that you shouldn't have to know if the iterator is lazy or not, that's an implementation detail. It certainly isn't an implementation deta
by Skunkleton 6y ago
> It makes the point that you shouldn't have to know if the iterator is lazy or not, that's an implementation detail.
It certainly isn't an implementation detail. How can you write a correct program without knowing this behavior?
- lixtra 6y agoThe fact that python changed that behavior in the past (i.e. range) shows that writing correct programs usually works in practice.
- Skunkleton 6y agoThe fact that python has a lazy and non-lazy range is pretty much the point. Yes there are (common) trivial cases where you don't care if the range is lazy or not, but in general it is something you need to be aware of.