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

Nick Coghlan ncoghlan at gmail.com
Mon May 1 11:49:46 CEST 2006


Terry Reedy wrote:
> "Nick Coghlan" <ncoghlan at gmail.com> wrote in message 
>> 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".

Actually, I misread Talin's PEP moreso than your question - I thought the 
first syntax change was about the earlier Py3k discussion of permitting 
'*args' before keyword arguments in a functional call. It seems that one is 
actually non-controversial enough to not really need a PEP at all :)

Reading the PEP again, I realise what you were actually asking, and have to 
say I agree the only use case that has been identified for keyword-only 
arguments is functions which accept an arbitrary number of positional arguments.

So +1 for the first change, -1 for the second.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-Dev mailing list