What's the business with the asterisk?
Tim Chase
python.list at tim.thechases.com
Sat Jan 24 07:46:34 EST 2009
> From time to time I spot an asterisk (*) used in the Python code
> _outside_ the usual *args or **kwargs application.
>
> E.g. here: http://www.norvig.com/python-lisp.html
>
> def transpose (m):
> return zip(*m)
> >>> transpose([[1,2,3], [4,5,6]])
> [(1, 4), (2, 5), (3, 6)]
>
> What does *m mean in this example and how does it do the magic here?
There's a good writeup on args/kwargs at
http://www.megasolutions.net/python/-args-and---kwargs-78766.aspx
(looks like the content was gleaned from comp.lang.python and
credited)
-tkc
More information about the Python-list
mailing list