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 ramiro
Recipients docs@python, ramiro
Date 2015-05-09.15:19:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431184757.15.0.93515789631.issue24148@psf.upfronthosting.co.za>
In-reply-to
Content
On the documentation page "The Python Profilers" https://docs.python.org/3.4/library/profile.html#instant-user-s-manual the following example is given:

p.sort_stats('time', 'cum').print_stats(.5, 'init')

This raises a KeyError, because 'cum' is not available as a sort key to pstats.Stats.sort_stats. As per the documentation of this method (https://docs.python.org/3.4/library/profile.html#the-stats-class) you can either use 'cumulative' or 'cumtime', which both work as expected.

Since 'cumulative' is used a few examples earlier I suggest to use that for consistency.

Tested with the following Python version:

Python 3.4.3 on Ubuntu 15.04
History
Date User Action Args
2015-05-09 15:19:17ramirosetrecipients: + ramiro, docs@python
2015-05-09 15:19:17ramirosetmessageid: <1431184757.15.0.93515789631.issue24148@psf.upfronthosting.co.za>
2015-05-09 15:19:17ramirolinkissue24148 messages
2015-05-09 15:19:16ramirocreate