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

"Martin v. Löwis" martin at v.loewis.de
Mon May 1 17:33:33 CEST 2006


Edward Loper wrote:
> Martin v. Löwis wrote:
>> One reason I see is to have keyword-only functions, i.e. with no
>> positional arguments at all:
>>
>> def make_person(*, name, age, phone, location):
>>     pass
> 
> But is it necessary to syntactically *enforce* that the arguments be
> used as keywords?

This really challenges the whole point of the PEP: keyword-only
arguments (at least, it challenges the title of the PEP, although
probably not the specified rationale).

> I.e., why not just document that the arguments should
> be used as keyword arguments, and leave it at that.

Because they wouldn't be keyword-only arguments, then.

Regards,
Martin


More information about the Python-Dev mailing list