[Python-ideas] Generator unpacking

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 15 02:12:33 EST 2016


Stephen J. Turnbull wrote:
> What would
> 
>     a, b, ... = some_list
> 
> mean?  (Using the OP's notation without prejudice to other notations.)
> Would it pop a and b off the list?

No, it would just assign the first two items of the list
to a and b and not care whether there were any more.

-- 
Greg


More information about the Python-ideas mailing list