diff options
author | Sanket Dasgupta <sanketdasgupta@gmail.com> | 2017-09-24 18:29:22 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2017-09-24 18:29:22 (GMT) |
commit | 5b9299d8c72aeadccadd77e4b8132094ba9a1f96 (patch) | |
tree | eb661d1332850e8f8e4e4b42ebf643fef79b0621 /Doc/library/operator.rst | |
parent | 5d3e80021ab33360191eb0fbff34e0246c913884 (diff) | |
download | cpython-5b9299d8c72aeadccadd77e4b8132094ba9a1f96.zip cpython-5b9299d8c72aeadccadd77e4b8132094ba9a1f96.tar.gz cpython-5b9299d8c72aeadccadd77e4b8132094ba9a1f96.tar.bz2 |
bpo-30085: Improve documentation for operator (#1171)
The dunderless functions are preferred; dunder are retained for back compatilibity.
Patch by Sanket Dasgupta.
Diffstat (limited to 'Doc/library/operator.rst')
-rw-r--r-- | Doc/library/operator.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 76335b1..e4d6d05 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. |