File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Glossary
4141
4242 argument
4343 A value passed to a :term: `function ` (or :term: `method `) when calling the
44- function. There are two types of arguments :
44+ function. There are two kinds of argument :
4545
4646 * :dfn: `keyword argument `: an argument preceded by an identifier (e.g.
4747 ``name= ``) in a function call or passed as a value in a dictionary
@@ -601,7 +601,7 @@ Glossary
601601 parameter
602602 A named entity in a :term: `function ` (or method) definition that
603603 specifies an :term: `argument ` (or in some cases, arguments) that the
604- function can accept. There are five types of parameters :
604+ function can accept. There are five kinds of parameter :
605605
606606 * :dfn: `positional-or-keyword `: specifies an argument that can be passed
607607 either :term: `positionally <argument> ` or as a :term: `keyword argument
@@ -615,6 +615,8 @@ Glossary
615615 parameters. However, some built-in functions have positional-only
616616 parameters (e.g. :func: `abs `).
617617
618+ .. _keyword-only_parameter :
619+
618620 * :dfn: `keyword-only `: specifies an argument that can be supplied only
619621 by keyword. Keyword-only parameters can be defined by including a
620622 single var-positional parameter or bare ``* `` in the parameter list
Original file line number Diff line number Diff line change 1010
1111--------------
1212
13- Note: This module exists for backwards compatibility only. For new code we
14- recommend using :module: `asyncio `.
13+ .. note ::
14+
15+ This module exists for backwards compatibility only. For new code we
16+ recommend using :mod: `asyncio `.
1517
1618This module builds on the :mod: `asyncore ` infrastructure, simplifying
1719asynchronous clients and servers and making it easier to handle protocols
Original file line number Diff line number Diff line change 1313
1414--------------
1515
16- Note: This module exists for backwards compatibility only. For new code we
17- recommend using :module: `asyncio `.
16+ .. note ::
17+
18+ This module exists for backwards compatibility only. For new code we
19+ recommend using :mod: `asyncio `.
1820
1921This module provides the basic infrastructure for writing asynchronous socket
2022service clients and servers.
Original file line number Diff line number Diff line change @@ -1149,6 +1149,9 @@ application).
11491149 fail, the entire sort operation will fail (and the list will likely be left
11501150 in a partially modified state).
11511151
1152+ :meth: `sort ` accepts two arguments that can only be passed by keyword
1153+ (:ref: `keyword-only arguments <keyword-only_parameter >`):
1154+
11521155 *key * specifies a function of one argument that is used to extract a
11531156 comparison key from each list element (for example, ``key=str.lower ``).
11541157 The key corresponding to each item in the list is calculated once and
Original file line number Diff line number Diff line change @@ -352,6 +352,13 @@ Tests
352352
353353- Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa.
354354
355+ Documentation
356+ -------------
357+
358+ - Issue #18326: Clarify that list.sort's arguments are keyword-only. Also,
359+ attempt to reduce confusion in the glossary by not saying there are
360+ different "types" of arguments and parameters.
361+
355362Build
356363-----
357364
You can’t perform that action at this time.
0 commit comments