Re: **kwargs?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: **kwargs?

From: Roland Heiber <newstonne@web.de>
Date: Wed Jul 13 2005 - 14:48:36 CEST

Francois De Serres wrote:
> All your **kwargs are belong to us.
>
> *args is documented in the Tutorial. I reckon **kwargs represents a
> dictionary of arguments. But I don't quite get the semantics of **x.
> Undefined length tuple of undefined length tuples? Are there other
> practical use cases for ** (common enough please, I wish I was, but I'm
> not a scientist).
>
> TIA,
> Francois
Assume d = { 'arg1':'value1','arg2':'value2' }. Then

func(**d)

is the same as:

func(arg1='value1', arg2='value2')

HtH, Roland
Received on Thu Sep 29 16:55:32 2005