[Python-Dev] PEP 3102: Keyword-only arguments (original) (raw)

Terry Reedy tjreedy at udel.edu
Fri May 5 23:26:51 CEST 2006


"Fred L. Drake, Jr." <fdrake at acm.org> wrote in message news:200605050951.04048.fdrake at acm.org...

On Friday 05 May 2006 02:38, Terry Reedy wrote: > My point has been that the function writer should not make such a > requirement (for four no-defaut, required params) and that proposing to > do > so with the proposed '*' is an abuse (for public code). The caller > should

And what exactly is the point at which constraining use goes from unreasonable to reasonable? Perhaps that involves a judgement call? I think it does.

Well, if so, it is my increasingly strong judgment that requiring another programmer to junk up his or her code with

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

instead of

make_person(name, age, phone, location)

or *

make_person(name=person_data[0], age=person_data[2], phone=person_data[3], location=person_data[3])

instead

make_person(*person_data)

is generally unreasonable. Remember, any person who actually prefers to write the longer forms is free to do so.

Since we're all consenting adults,

That is the basis for my objection. Most of the 'reasons' given for imposing the longer forms above have been about not treating function-calling programmers as fellow consenting adults, or rather, about treating them as non-adults.

One exception is the claim that in the alpha phase of a library project, the developer might be willing to freeze parameter names before freezing parameter positions. But this should be rare, temporary, and might be dealt with as well by the common procedure of stating that function signatures (APIs) are subject to change, while indicating which aspect are considered most stable or unstable.

we should have the tools to make our judgements easy to apply.

The discussion is about a tool to make a very disputable judgment easier to impose on others

Since it requires specific action to make the constraint (insertion of the "*" marker), there doesn't appear to be any real issue here.

I do not see the logic of this statement. I could just as well claim that it is constraints that require action, and which are therefore, in a sense, optional, that are disputable issues.

Terry Jan Reedy



More information about the Python-Dev mailing list