Doc for extended call syntax; was: Re: unzip array of arrays?

Steve Holden steve at holdenweb.com
Sat Jan 24 19:46:50 CET 2009


Bryan Olson wrote:
> Tobiah wrote:
>> Where can I read about
>> this mysterious use of the '*'?
> 
> Hmmm... that's a harder question than I thought. Am I missing it, or
> does Python's doc need a write-up of the extended call syntax?
> 
No, you aren't mistaken. Looking at the "*" symbol in the 2.6
documentation index it lists only two references. The first is the
language manual's explanation of its use in the def statement, the
second is a transitory reference to its use in function calls, but
that's in the tutorial where it is not likely to get much attention.

>> It only works in the
>> context of the zip() function.  It's hard to understand
>> how the interpreter handles that.
> 
> It works generally, for any callable. See the doc for 'apply':
> 
> http://docs.python.org/library/functions.html#non-essential-built-in-functions
> 
> 
> It not only works in a call, but also in function definitions. You can
> call a function with the extended call syntax whether or not is defined
> with * and ** arguments.
> 
> 
regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list