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

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

[Python-Dev] PEP 3102: Keyword-only arguments [Python-Dev] PEP 3102: Keyword-only argumentsMichael Urman murman at gmail.com
Fri May 5 15:20:02 CEST 2006
On 5/5/06, Terry Reedy <tjreedy at udel.edu> wrote:
> At present, Python allows this as a choice.

Not always - take a look from another perspective:

def make_person(**kwds):
    name = kwds.pop('name', None)
    age = kwds.pop('age', None)
    phone = kwds.pop('phone', None)
    location = kwds.pop('location', None)
    ...

This already requires the caller to use keywords, but results in
horrid introspection based documentation. You know it takes some
keywords, but you have no clue what keywords they are. It's as bad as
calling help() on many of the C functions in the python stdlib.

So what allowing named keyword-only arguments does for us is allows us
to document this case. That is an absolute win.

Michael
--
Michael Urman  http://www.tortall.net/mu/blog
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