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/099482.html below:

[Python-Dev] Very Strange Argument Handling Behavior

[Python-Dev] Very Strange Argument Handling Behavior [Python-Dev] Very Strange Argument Handling BehaviorVinay Sajip vinay_sajip at yahoo.co.uk
Sat Apr 17 14:41:03 CEST 2010
Steve Holden <steve <at> holdenweb.com> writes:

> I'm sure we wouldn't want to go so far as to inhibit this. (Py 3.1)
> 
> >>> def f(**kwargs):
> ...   kwargs[1] = "dummy"
> ...   print(kwargs)
> ...
> >>> f(this="Guido", that="Raymond", the_other="Steve")
> {'this': 'Guido', 1: 'dummy', 'the_other': 'Steve', 'that': 'Raymond'}

I think that according to the proposal, the above snippet would be OK, but

def f(**kwargs):
    kwargs[1] = 'dummy'
    g(**kwargs)

would fail at the call of g.

Regards,

Vinay Sajip

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