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

2009-01-27 Thread Mark Wooding
Bryan Olson  writes:

> Mark Wooding wrote:
>> There's a full description of it in 5.4.3 in the Language Reference, but
>> apparently not indexed.
>
> So I guess this means I can duck out of writing up a lecture on my own
> understanding of Python's extended call syntax. Great.
>
> I think I grock the extended call syntax, and when the question came
> up I was surprised not to be able to find where I learned it. Mark,
> where exactly does one look to see this "full description"?

I typoed, sorry!  I should have written 5.3.4:

http://www.python.org/doc/2.5/ref/calls.html

The description of the fancy * and ** syntax starts with `If the syntax
``*expression'' appears in the function call...'.

-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list


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

2009-01-27 Thread Bryan Olson

Mark Wooding wrote:

Steve Holden writes:


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.


There's a full description of it in 5.4.3 in the Language Reference, but
apparently not indexed.


So I guess this means I can duck out of writing up a lecture on my own 
understanding of Python's extended call syntax. Great.


I think I grock the extended call syntax, and when the question came up 
I was surprised not to be able to find where I learned it. Mark, where 
exactly does one look to see this "full description"?



--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list


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

2009-01-25 Thread Mark Wooding
Steve Holden  writes:

> 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.

There's a full description of it in 5.4.3 in the Language Reference, but
apparently not indexed.

-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list


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

2009-01-24 Thread Steve Holden
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/

--
http://mail.python.org/mailman/listinfo/python-list


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

2009-01-24 Thread Bryan Olson

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?



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.



--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list