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

Antoine Pitrou solipsis at pitrou.net
Tue Dec 20 11:08:30 CET 2011


Le mardi 20 décembre 2011 à 12:01 +0200, Maciej Fijalkowski a écrit :
> 
> If this documentation is to be used by other python implementations,
> then mentions of performance are outright harmful, since the
> performance characteristics differ quite drastically. Written in C is
> also not a part of specification as far as I know :)

But that's basically the only reason to invoke the
`operator.attrgetter("foo")` ugliness, instead of writing the explicit
and obvious `lambda x: x.foo`.
So not mentioning that it provides a speed benefit on CPython hides the
primary reason for using the operator module. Overwise it's just a bunch
of useless wrappers.

---------

More generally, not talking about performance at all is more harmful
than making CPython-specific comments in the documentation. 

Implementation details *deserve* to be documented when they have an
impact on behaviour (including performance / resource usage). Python is
not just a platonic ideal. Do you suggest we also remove this part:
http://docs.python.org/dev/library/io.html#performance
?

Regards

Antoine.




More information about the Python-Dev mailing list