Python Profilers documentation - typo?
The documentation at https://docs.python.org/3.2/library/profile.html contains the sentence For example, if your_integer_time_func() returns times measured in thousands of seconds, you would construct the Profile instance as follows: "thousands of seconds" should ISTM be "thousandths of a second". There is essentially the same thing in the Python 2 docs at https://docs.python.org/2/library/profile.html viz. For example, if the timer returns times measured in _thousands_ of seconds, the time unit would be |.001|. Just trying for perfection! Best wishes Rob Cliffe
Pretty embarrassing, I agree. Can you submit a PR? On Tue, Oct 8, 2019 at 17:38 Rob Cliffe via Python-Dev < python-dev@python.org> wrote:
The documentation at https://docs.python.org/3.2/library/profile.html contains the sentence For example, if your_integer_time_func() returns times measured in thousands of seconds, you would construct the Profile instance as follows:
"thousands of seconds" should ISTM be "thousandths of a second".
There is essentially the same thing in the Python 2 docs at https://docs.python.org/2/library/profile.html viz. For example, if the timer returns times measured in *thousands* of seconds, the time unit would be .001.
Just trying for perfection! Best wishes Rob Cliffe _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/JNAFSXJS... Code of Conduct: http://python.org/psf/codeofconduct/
-- --Guido (mobile)
On Wed, Oct 9, 2019 at 11:44 AM Rob Cliffe via Python-Dev <python-dev@python.org> wrote:
The documentation at https://docs.python.org/3.2/library/profile.html contains the sentence For example, if your_integer_time_func() returns times measured in thousands of seconds, you would construct the Profile instance as follows:
"thousands of seconds" should ISTM be "thousandths of a second".
There is essentially the same thing in the Python 2 docs at https://docs.python.org/2/library/profile.html viz. For example, if the timer returns times measured in thousands of seconds, the time unit would be .001.
Python 3.2 is out of support, but the text is the same in current versions: https://docs.python.org/3/library/profile.html The wording in cProfile.Profile.__cod__ (as per help() etc) is: For custom timer functions returning integers, timeunit can be a float specifying a scale (i.e. how long each integer unit is, in seconds). Which supports your expectation that this should be "thousandths of a second". The wording currently in the docs appears to date all the way back to the introduction of the module in 2006, and other than formatting changes, hasn't been touched since. I think your wording would be correct. The file to change is Doc/library/profile.rst if you want to put in a patch. ChrisA
participants (3)
-
Chris Angelico
-
Guido van Rossum
-
Rob Cliffe