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/2011-March/110039.html below:

[Python-Dev] Dict access with double-dot (syntactic sugar)

[Python-Dev] Dict access with double-dot (syntactic sugar) [Python-Dev] Dict access with double-dot (syntactic sugar)Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 24 22:00:49 CET 2011
Jameson Quinn wrote:

> def fun2(**kw):
>     print kw["argument"]

Since this function effectively has a compulsory argument
called 'argument', it would be better written

   def fun2(argument, **kw):
     print argument

or, if the recently-added keyword-only feature is available,

   def fun2(*, argument, **kw):
     print argument

-- 
Greg
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