A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-April/099428.html below:

[Python-Dev] Very Strange Argument Handling Behavior

[Python-Dev] Very Strange Argument Handling Behavior [Python-Dev] Very Strange Argument Handling BehaviorOleg Broytman phd at phd.pp.ru
Fri Apr 16 09:31:31 CEST 2010
On Fri, Apr 16, 2010 at 12:57:06AM -0400, Alex Gaynor wrote:
> >>> def f(**kwargs):
> ...     print(kwargs)
> ...
> >>> kwargs = {1: 3}
> >>>
> >>> dict({}, **kwargs)
> {1: 3}
> >>> f(**kwargs)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: f() keywords must be strings

   Argument names must be strings. In your example 1 must be at least '1'.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4