[Python-Dev] cpython (3.2): don't mention implementation detail

Antoine Pitrou solipsis at pitrou.net
Tue Dec 20 09:51:49 CET 2011


On Mon, 19 Dec 2011 22:42:43 +0100
benjamin.peterson <python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/d85efd73b0e1
> changeset:   74088:d85efd73b0e1
> branch:      3.2
> parent:      74082:71e5a083f9b1
> user:        Benjamin Peterson <benjamin at python.org>
> date:        Mon Dec 19 16:41:11 2011 -0500
> summary:
>   don't mention implementation detail
> 
> files:
>   Doc/library/operator.rst |  10 +++++-----
>   1 files changed, 5 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
> --- a/Doc/library/operator.rst
> +++ b/Doc/library/operator.rst
> @@ -12,11 +12,11 @@
>     from operator import itemgetter, iadd
>  
>  
> -The :mod:`operator` module exports a set of functions implemented in C
> -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.

I disagree with this change. Knowing that they are written in C is
important when deciding to pass them to e.g. sort() or sorted(),
because you know it will be faster than an arbitrary pure Python
function.

You could tag it as a "CPython implementation detail" if you want, or
talk about performance rather than mention "C".

Regards

Antoine.




More information about the Python-Dev mailing list