[Python-ideas] Generator unpacking

Nick Coghlan ncoghlan at gmail.com
Sun Feb 14 02:43:53 EST 2016


On 14 February 2016 at 07:40, Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:

>
> Another possibility is
>
>    a, b, ... = value


Now, *that* spelling to turn off the "implicit peek" behaviour in iterable
unpacking I quite like.

    arg_iter = iter(args)
    command, ... = arg_iter
    run_command(command, arg_iter)

Although again, the main downside would be that "..." here means something
rather different from what it means as a subscript element.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160214/ef02ec82/attachment.html>


More information about the Python-ideas mailing list