[Python-Dev] Extending tuple unpacking (original) (raw)

Gustavo Niemeyer gustavo at niemeyer.net
Fri Oct 7 19:22:37 CEST 2005


Not sure if this has been proposed before, but one thing I occasionally miss regarding tuple unpack is being able to do:

first, second, *rest = something

Also in for loops:

for first, second, *rest in iterator: pass

This seems to match the current meaning for starred variables in other contexts.

What do you think?

-- Gustavo Niemeyer http://niemeyer.net



More information about the Python-Dev mailing list