Eric McGraw wrote:
> You could call it like this:
foo(**{"a-special-keyword":5})
> but that might defeat the purpose of keyword arguments.
>
Don't forget you can mix ordinary keyword arguments with the ** call, so
only the weird arguments actually need to be passed that way.
>>> def f(**ar
You could call it like this:
>>> foo(**{"a-special-keyword":5})
but that might defeat the purpose of keyword arguments.
--
http://mail.python.org/mailman/listinfo/python-list
Hi Fletch,
...
>>> How do I tell Python to treat '-' as a normal character but not part
>>> of an expression?
>>>
>>
>> By changing the parser :-)
>>
>>
> Oh, you py-py guys, always thinking you have to re-implement Python ;)
Well, in the given context, assuming keywords are supposed
to be
Thanks for your responses. I guess the foo(**{'x-y':3}) is ugly but will do the trick Cheers,Khoa On 1/5/06, Mike C. Fletcher <
[EMAIL PROTECTED]> wrote:Christian Tismer wrote:>Khoa Nguyen wrote:
I would like to pass some keyword with special character to a>>foo(**kwargs) function, but it doesn
Khoa Nguyen wrote:
> 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 pa
I would like to pass some keyword with special character to a foo(**kwargs) function, but it doesn't workdef foo(**kwargs): print kwargsThis 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
--
http://mail.py