On 23 April 2013 22:29, Oscar Benjamin <oscar.j.benja...@gmail.com> wrote:

> I just thought I'd add that Python 3 has a convenient way to avoid
> this problem with next() which is to use the starred unpacking syntax:
>
> >>> numbers = [1, 2, 3, 4]
> >>> first, *numbers = numbers
>

That creates a new list every time. You'll not want that over
try-next-except if you're doing this in a loop, and on addition (if you
were talking in context) your method will exhaust the iterator in the outer
loop.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to