Re: [Python-Dev] PEP 340 - For loop cleanup, and feature separation

2005-05-06 Thread Phillip J. Eby
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

[Python-Dev] PEP 340 - For loop cleanup, and feature separation

2005-05-05 Thread Greg Ewing
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

Re: [Python-Dev] PEP 340 - For loop cleanup, and feature separation

2005-05-05 Thread Delaney, Timothy C (Timothy)
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