[Python-checkins] bpo-30085: Improve documentation for operator (#1171)

Terry Jan Reedy webhook-mailer at python.org
Sun Sep 24 14:29:24 EDT 2017


https://github.com/python/cpython/commit/5b9299d8c72aeadccadd77e4b8132094ba9a1f96
commit: 5b9299d8c72aeadccadd77e4b8132094ba9a1f96
branch: master
author: Sanket Dasgupta <sanketdasgupta at gmail.com>
committer: Terry Jan Reedy <tjreedy at udel.edu>
date: 2017-09-24T14:29:22-04:00
summary:

bpo-30085: Improve documentation for operator (#1171)

The dunderless functions are preferred; dunder are retained for back compatilibity.
Patch by Sanket Dasgupta.

files:
A Misc/NEWS.d/next/Documentation/2017-09-14-18-44-50.bpo-30085.0J9w-u.rst
M Doc/library/operator.rst

diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 76335b179c5..e4d6d05a23a 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -17,9 +17,10 @@
 
 The :mod:`operator` module exports a set of efficient functions corresponding to
 the intrinsic operators of Python.  For example, ``operator.add(x, y)`` is
-equivalent to the expression ``x+y``.  The function names are those used for
-special class methods; variants without leading and trailing ``__`` are also
-provided for convenience.
+equivalent to the expression ``x+y``. Many function names are those used for
+special methods, without the double underscores.  For backward compatibility,
+many of these have a variant with the double underscores kept. The variants
+without the double underscores are preferred for clarity.
 
 The functions fall into categories that perform object comparisons, logical
 operations, mathematical operations and sequence operations.
diff --git a/Misc/NEWS.d/next/Documentation/2017-09-14-18-44-50.bpo-30085.0J9w-u.rst b/Misc/NEWS.d/next/Documentation/2017-09-14-18-44-50.bpo-30085.0J9w-u.rst
new file mode 100644
index 00000000000..c8be050009c
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2017-09-14-18-44-50.bpo-30085.0J9w-u.rst
@@ -0,0 +1,2 @@
+The operator functions without double underscores are preferred for clarity.
+The one with underscores are only kept for back-compatibility.



More information about the Python-checkins mailing list