How to with **kw

Tim Hochberg tim.hochberg at ieee.org
Wed Jan 5 22:39:13 EST 2000


<wiktor1325 at my-deja.com> wrote in message
news:850vre$v3h$1 at nnrp1.deja.com...
> Is there a way to pass **kw args from
> one function to another,like:
>
> def func1(**kw):
>   for key in kw.keys():
>      print key
>
> def func2(**kw):
>   a_way_to_call_func1_with(kw)
>
> thanks in advance

You probably want to use apply:

def func2(**kw):
    apply(func1, (), kw) # () is the nonkw args.

-tim





More information about the Python-list mailing list