[Twisted-Python] Escaping variable names

Maarten ter Huurne maarten at treewalker.org
Fri Mar 5 10:55:10 MST 2010


On Friday 05 March 2010, Kamil Wasilewski wrote:
> > server.doGetCountries(**{
> >         'country-code': COUNTRYID, 'webapi-key': WEBAPIKEY
> >         })
> 
>           The above gives a syntax error...

What kind of syntax error? I tested this approached on the interactive 
Python shell and it worked fine there:

>>> def f(**kvargs):
...   print kvargs
... 
>>> f(a = 1, **{'b-c': 12})
{'a': 1, 'b-c': 12}

Bye,
		Maarten




More information about the Twisted-Python mailing list