On Thursday, February 18, 2016 at 11:12:45 AM UTC+5:30, Steven D'Aprano wrote:
> Today I learned that **kwargs style keyword arguments can be any string:
>
>
> py> def test(**kw):
> ... print(kw)
> ...
> py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
> py> test(**kwargs)
> {'':
Steven D'Aprano writes:
> A work colleague wanted to pass an argument starting with "-" to a
> function.
>
> Apparently he didn't have a specific argument in mind. He just wanted
> to test the function to breaking point by passing invalid argument
> names.
That seems a reasonable test.
>>>
On Thu, 18 Feb 2016 06:55 pm, Mark Lawrence wrote:
> On 18/02/2016 05:42, Steven D'Aprano wrote:
>> Today I learned that **kwargs style keyword arguments can be any string:
>>
>> py> def test(**kw):
>> ... print(kw)
>> ...
>> py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
>> py> t
On 18/02/2016 05:42, Steven D'Aprano wrote:
Today I learned that **kwargs style keyword arguments can be any string:
py> def test(**kw):
... print(kw)
...
py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
py> test(**kwargs)
{'': 23, '123': 17, '---': 999, 'abc-def': 42}
Bug or fea
On 2/18/2016 12:59 AM, Ben Finney wrote:
Steven D'Aprano writes:
Today I learned that **kwargs style keyword arguments can be any string:
py> def test(**kw):
... print(kw)
...
py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
py> test(**kwargs)
{'': 23, '123': 17, '---': 999, '
Steven D'Aprano writes:
> Today I learned that **kwargs style keyword arguments can be any string:
>
>
> py> def test(**kw):
> ... print(kw)
> ...
> py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
> py> test(**kwargs)
> {'': 23, '123': 17, '---': 999, 'abc-def': 42}
>
>
> Bug or
On Thu, Feb 18, 2016 at 4:42 PM, Steven D'Aprano
wrote:
> Today I learned that **kwargs style keyword arguments can be any string:
>
>
> py> def test(**kw):
> ... print(kw)
> ...
> py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17}
> py> test(**kwargs)
> {'': 23, '123': 17, '---': 999