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

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

[Python-Dev] PEP 3102: Keyword-only arguments [Python-Dev] PEP 3102: Keyword-only argumentsTerry Reedy tjreedy at udel.edu
Sun Apr 30 05:30:38 CEST 2006
"Talin" <talin at acm.org> wrote in message news:4453B025.3080100 at acm.org...
>
>         def sortwords(*wordlist, case_sensitive=False):

The rationale for this is pretty obvious.  But ...

>     The second syntactical change is to allow the argument name to
>     be omitted for a varargs argument:
>
>         def compare(a, b, *, key=None):
>             ...
>
>     The reasoning behind this change is as follows.  Imagine for a
>     moment a function which takes several positional arguments, as
>     well as a keyword argument:
>
>         def compare(a, b, key=None):
>             ...
>
>     Now, suppose you wanted to have 'key' be a keyword-only argument.

Why?  Why not let the user type the additional argument(s) without the 
parameter name?

tjr



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