Georg Brandl wrote:

> Indeed, you almost always have to have a try-except StopIteration-
> wrapper around "manual" calls to .next().

An alternative way of addressing this would be to
have a new control structure. We already have the
'for' statement for when you want all the values;
why not another one for when you just want one
value? Maybe something like

   get item from iter:
     # code for when we got something
   else:
     # code for when we didn't get anything

--
Greg
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to