[Python-ideas] Possible new itertool: comm()

Ethan Furman ethan at stoneleaf.us
Tue Jan 6 19:43:23 CET 2015

On 01/06/2015 10:30 AM, Paul Moore wrote:
> On 6 January 2015 at 18:28, Ethan Furman <ethan at stoneleaf.us> wrote:
>> On 01/06/2015 10:00 AM, Steven D'Aprano wrote:
>>>     a = next(it1, MISSING)
>>>     b = next(it2, MISSING)
>> Don't forget to guard your next calls -- RunTimeError would not be a friendly way to stop iterating.  ;)
> Doesn't the second argument get used instead of raising StopIteration?

Yup, it sure does.  Guess I should have paid more attention to that niggling feeling that I was missing something.  ;)
On the other hand, I figured even if I was wrong it wouldn't hurt to increase awareness about the change to generators.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150106/3ef9a927/attachment.sig>

More information about the Python-ideas mailing list