[docs] [issue18326] Mention 'keyword only' for list.sort, improve glossary.

Terry J. Reedy report at bugs.python.org
Fri Jul 5 20:57:14 CEST 2013

Terry J. Reedy added the comment:

'keyword argument' refers one to 'argument'. The entry for the latter says that there are only two types of arguments, keyword and positional. That is true as to how actual arguments are passed.

There are 3 possibilities for how a single argument for a parameter might be passed:
standard - positional or keyword
positional only (args for many C functions, not specifically indicated)
keyword only (follow '*' or '*args' after signature.

These are explained in the parameter entry. Keyword-only parameters have to be matched by keyword arguments.

I think it a bit misleading to say "There are two types of arguments". That actually means "There are two ways of passing an argument". Precede it by 'name=' or not. An object is the same whether passed by name or position.

Calling a name a keyword in this context is also misleading since 'keyword' otherwise means a reserved word that cannot be used as a name. Using an actual keyword to name an argument is illegal: 'for = 2' raises.

nosy: +terry.reedy
title: Mention keywork only in list.sort docs -> Mention 'keyword only' for list.sort, improve  glossary.

Python tracker <report at bugs.python.org>

More information about the docs mailing list