*args and **opts oddities (?)

Dinu Gherman gherman at darwin.in-berlin.de
Thu Nov 29 06:50:23 EST 2001


On Thu, 29 Nov 2001 10:44:17 GMT, Michael Hudson <mwh at python.net>
wrote:

>Think about what this does; it calls transform0 with two positional
>arguments, the tuple `args', and the dictionary `opts'.  These then go
>into the `*args' parameter of transform0, and the dictionary `opts' is
>empty -- because there weren't any keyword arguments.

Argh, stupid me - of course!

>Did you want to write
>
>    args, opts = transform0(*args, **opts)

I guess I meant to write:

  apply(transform0, args, opts)

Thanks!

Dinu

-- 
Dinu C. Gherman
dinu at reportlab dot com
http://www.reportlab.com
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")



More information about the Python-list mailing list