Returning a variable number of things...

r0g aioe.org at technicalbloke.com
Sat Feb 7 05:19:24 CET 2009


Chris Rebert wrote:
> 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.
> 
> Despite its name, tuple unpacking works with lists too.
> 
> Cheers,
> Chris
> 

Ah so it does! Thanks Chris! I'm losing count of all the reasons I have
to love this language :-)



More information about the Python-list mailing list