Returning a variable number of things...

Stephen Hansen apt.shansen at gmail.com
Fri Feb 6 13:57:45 EST 2009


On Fri, Feb 6, 2009 at 10:50 AM, r0g <aioe.org at technicalbloke.com> wrote:

> Hi There,
>
> I have a function that uses *args to accept a variable number of
> parameters and I would like it to return a variable number of objects.
>

> I could return a list but I would like to take advantage of tuple
> unpacking with the return values e.g.


Just return the list :)

It'll unpack any sequence, not just tuples.

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090206/99333df2/attachment-0001.html>


More information about the Python-list mailing list