"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Terry Reedy wrote:
>> "Talin" <[EMAIL PROTECTED]> wrote in message 
>> news:[EMAIL PROTECTED]
>>>     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?

Like Martin, you clipped most of the essential context of my question: 
Talin's second proposal.
>>>    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):

Again I ask, why would one want that?  And, is the need for that so strong 
as to justify introducing '*' as a pseudoparameter?

> Because for some functions (e.g. min()/max()) you want to use *args, but
> support some additional keyword arguments to tweak a few aspects of the
> operation (like providing a "key=x" option).

This and the rest of your 'explanation' is about Talin's first proposal, to 
which I already had said "The rationale for this is pretty obvious".

Terry Jan Reedy



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to