Any thoughts on logging a warning, perhaps behind an opt-in flag? I could not find a single false positive scenario, so I expect the signal-to-noise ratio to be high and prevent lots of bugs.
On 13/06/23 9:59 am, Rob Cliffe via Python-ideas wrote:
> Also the OP's request was for generators, not for any iterator.
IMO it would be a bad idea to make generators behave differently
from other iterators in this regard. And it's far too late to
redefine the iterator protocol in general, because that would
require changing all existing iterators and all existing code
that relies on the current behaviour.
--
Greg
_______________________________________________