At 01:58 PM 5/6/2005 +1000, Delaney, Timothy C (Timothy) wrote:
Personally, I'm of the opinion that we should make a significant break
(no pun intended ;) and have for-loops attempt to ensure that iterators
are exhausted.
This is simply not backward compatible with existing, perfectly valid and
I'm still bothered by the idea of for-loops not participating
in the new generator finalization protocol.
It's all very well to say that iterators designed for block
statements shouldn't be used in for-loops, but there may
be more subtle cases to consider, such as
def
Greg Ewing wrote:
I'm still bothered by the idea of for-loops not participating
in the new generator finalization protocol.
I agree - that's always been nagging at me too.
The problem with it is that then you either:
1. Have a guarantee that an iterator will be exhausted when the for loop