[Python-checkins] cpython (merge default -> default): trunk merge

barry.warsaw python-checkins at python.org
Fri Nov 22 21:31:58 CET 2013


http://hg.python.org/cpython/rev/307122160def
changeset:   87370:307122160def
parent:      87369:8a130fd92255
parent:      87368:f3eb4a1b27c9
user:        Barry Warsaw <barry at python.org>
date:        Fri Nov 22 15:31:49 2013 -0500
summary:
  trunk merge

files:
  Doc/glossary.rst         |  6 ++++--
  Doc/library/asynchat.rst |  6 ++++--
  Doc/library/asyncore.rst |  6 ++++--
  Doc/library/stdtypes.rst |  3 +++
  Misc/NEWS                |  7 +++++++
  5 files changed, 22 insertions(+), 6 deletions(-)


diff --git a/Doc/glossary.rst b/Doc/glossary.rst
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -41,7 +41,7 @@
 
    argument
       A value passed to a :term:`function` (or :term:`method`) when calling the
-      function.  There are two types of arguments:
+      function.  There are two kinds of argument:
 
       * :dfn:`keyword argument`: an argument preceded by an identifier (e.g.
         ``name=``) in a function call or passed as a value in a dictionary
@@ -601,7 +601,7 @@
    parameter
       A named entity in a :term:`function` (or method) definition that
       specifies an :term:`argument` (or in some cases, arguments) that the
-      function can accept.  There are five types of parameters:
+      function can accept.  There are five kinds of parameter:
 
       * :dfn:`positional-or-keyword`: specifies an argument that can be passed
         either :term:`positionally <argument>` or as a :term:`keyword argument
@@ -615,6 +615,8 @@
         parameters.  However, some built-in functions have positional-only
         parameters (e.g. :func:`abs`).
 
+      .. _keyword-only_parameter:
+
       * :dfn:`keyword-only`: specifies an argument that can be supplied only
         by keyword.  Keyword-only parameters can be defined by including a
         single var-positional parameter or bare ``*`` in the parameter list
diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst
--- a/Doc/library/asynchat.rst
+++ b/Doc/library/asynchat.rst
@@ -10,8 +10,10 @@
 
 --------------
 
-Note: This module exists for backwards compatibility only.  For new code we
-recommend using :module:`asyncio`.
+.. note::
+
+   This module exists for backwards compatibility only.  For new code we
+   recommend using :mod:`asyncio`.
 
 This module builds on the :mod:`asyncore` infrastructure, simplifying
 asynchronous clients and servers and making it easier to handle protocols
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
--- a/Doc/library/asyncore.rst
+++ b/Doc/library/asyncore.rst
@@ -13,8 +13,10 @@
 
 --------------
 
-Note: This module exists for backwards compatibility only.  For new code we
-recommend using :module:`asyncio`.
+.. note::
+
+   This module exists for backwards compatibility only.  For new code we
+   recommend using :mod:`asyncio`.
 
 This module provides the basic infrastructure for writing asynchronous  socket
 service clients and servers.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1149,6 +1149,9 @@
       fail, the entire sort operation will fail (and the list will likely be left
       in a partially modified state).
 
+      :meth:`sort` accepts two arguments that can only be passed by keyword
+      (:ref:`keyword-only arguments <keyword-only_parameter>`):
+
       *key* specifies a function of one argument that is used to extract a
       comparison key from each list element (for example, ``key=str.lower``).
       The key corresponding to each item in the list is calculated once and
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -352,6 +352,13 @@
 
 - Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa.
 
+Documentation
+-------------
+
+- Issue #18326: Clarify that list.sort's arguments are keyword-only.  Also,
+  attempt to reduce confusion in the glossary by not saying there are
+  different "types" of arguments and parameters.
+
 Build
 -----
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list