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/2006-May/064804.html below:

[Python-Dev] PEP 3102: Keyword-only arguments

[Python-Dev] PEP 3102: Keyword-only arguments [Python-Dev] PEP 3102: Keyword-only argumentsGreg Ewing greg.ewing at canterbury.ac.nz
Wed May 3 03:22:50 CEST 2006
Guido van Rossum wrote:
> On 5/2/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> >    make_person(=name, =age, =phone, =location)
> 
> And even with Terry's use case quoted I can't make out what you meant
> that to do.

I meant it to do the same thing as

   make_person(name=name, age=age, phone=phone, location=location)

I come across use cases for this fairly frequently, usually
when I have an __init__ method that supplies default values
for a bunch of arguments, and then wants to pass them on to
an inherited __init__ with the same names. It feels very
wanky having to write out all those foo=foo expressions.

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