Passing tuples transparently as function parameters (like for Threads)

Fredrik Lundh fredrik at effbot.org
Mon Oct 30 12:52:58 EST 2000


David Perry wrote:
> Hey all!  This may be an RTFM, but if it is, please point me at
> the right FM. (:

how about checking the FAQ?

    http://www.python.org/doc/FAQ.html#4.31
    How do I call a function if I have the arguments in a tuple?

    Use the built-in function apply().

:::

for the full story on apply, see the fine manual:

    http://www.python.org/doc/current/lib/built-in-funcs.html

in 2.0, you can also use syntactic sugar: func(*args, **kw) is
the same thing as apply(func, args, kw).

</F>





More information about the Python-list mailing list