This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve21
Recipients mark.dickinson, steve21
Date 2009-08-24.02:04:21
SpamBayes Score 7.094776e-07
Marked as misclassified No
Message-id <1251079462.94.0.0327266370214.issue6765@psf.upfronthosting.co.za>
In-reply-to
Content
Mark,
"... that's what log10 is there for". That would be a good point if the
documentation said that. However, all the docs for log10 say is:

math.log10(x)
    Return the base-10 logarithm of x.

So we have a python function log10() which looks like it is redundant
since we can use log(a, 10) instead. But it actually functions
differently to log(a, 10), and the Python user would never know this
from looking at the documentation.

I think Tim Peters missed one important guideline in his "The Zen of
Python". The principle of least astonishment (or surprise) - when two
elements of an interface conflict, or are ambiguous, the behaviour
should be that which will least surprise the human user or programmer at
the time the conflict arises.

Its easy for the python developer to ignore this guideline. They know
the implementation, and are rarely surprised by inconsistent behaviour
since they have seen it before, or even created it without documenting it.

If Python functions are inconsistent then I think they should either be
made consistent, or if that's not possible they should be clearly
documented as being inconsistent.

The docs for log(x[, base]) could be improved to say:
"this function preserves the consistency of log(a,b) == log(a)/log(b)
but breaks consistency with log(a,10) == log10(a)"

The docs for log10(x) could be improved to say:
"this function gives the correct result for powers of 10,
but breaks consistency with log(a,10) == log10(a)"
History
Date User Action Args
2009-08-24 02:04:23steve21setrecipients: + steve21, mark.dickinson
2009-08-24 02:04:22steve21setmessageid: <1251079462.94.0.0327266370214.issue6765@psf.upfronthosting.co.za>
2009-08-24 02:04:21steve21linkissue6765 messages
2009-08-24 02:04:21steve21create