This idea occurred to me in context of PEP 479 and the "or stop()" hack for generator expressions. I'm not a big enough fan of the idea to pursue it myself, but if anyone is bothered by the prospect of PEP 479 taking the "or stop()" technique away, this may be worth pursuing further.
As a reminder of how the hack works, the following generator:
>>> def takewhile(iterable, pred):
... for x in iter(iterable):
... if not pred(x):
... return
... yield x
...
>>> list(takewhile(range(10), (lambda x: x < 5)))
[0, 1, 2, 3, 4]
Can currently be converted to a generator expression with the aid of a helper function:
...