How to with **kw

Michael Haggerty mhagger at blizzard.harvard.edu
Wed Jan 5 22:53:27 EST 2000


wiktor1325 at my-deja.com writes:

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

The canonical way would be

    def func2(**kw):
        apply(func1, (), kw)

Michael

-- 
Michael Haggerty
mhagger at blizzard.harvard.edu



More information about the Python-list mailing list