A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/050030.html below:

[Python-Dev] Re: syntactic shortcut - unpack to variably sized list

[Python-Dev] Re: syntactic shortcut - unpack to variably sized listTerry Reedy tjreedy at udel.edu
Fri Nov 19 21:06:27 CET 2004
"Carlos Ribeiro" <carribeiro at gmail.com> wrote in message 
news:864d37090411190724440dfe38 at mail.gmail.com...
> For more than a few arguments, it seems to be silly to require the
> user to write it as:
> a,b,c,d,e = t[0],t[1],t[2],t[3],t[4:]

and also impossible.
>>> t=range(10)
>>> a,b,c,d=t[:4]; e=t[4:]
>>> a,b,c,d,e
(0, 1, 2, 3, [4, 5, 6, 7, 8, 9])

but this does require that return values be captured in a temporary first. 
This issue has come up enough that a PEP would be useful (if there isn't 
one already).

Terry J. Reedy



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4