Python function with **kwargs Question

Khoa Nguyen khoa.coffee at gmail.com
Thu Jan 5 14:46:16 EST 2006


I would like to pass some keyword with special character to a foo(**kwargs)
function, but it doesn't work

def foo(**kwargs):
  print kwargs


This doesn't work:

foo(a-special-keyword=5)

How do I tell Python to treat '-' as a normal character but not part of an
expression?

Thanks,
Khoa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060105/36a1b490/attachment.html>


More information about the Python-list mailing list