Skip to content

Commit 2929235

Browse files
committed
Improve docs for pstat module and profile.
Clarify that methods takes a string which is interpreted as a re, and not a re object. Clarify what the old `-1`, `0`, `1` and `2` option were.
1 parent 112ec38 commit 2929235

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/profile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Analysis of the profiler data is done using the :class:`~pstats.Stats` class.
444444
significant entries. Initially, the list is taken to be the complete set
445445
of profiled functions. Each restriction is either an integer (to select a
446446
count of lines), or a decimal fraction between 0.0 and 1.0 inclusive (to
447-
select a percentage of lines), or a regular expression (to pattern match
447+
select a percentage of lines), or a string that will interpreted as a regular expression (to pattern match
448448
the standard name that is printed. If several restrictions are provided,
449449
then they are applied sequentially. For example::
450450

Lib/pstats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Stats:
4848
printed.
4949
5050
The sort_stats() method now processes some additional options (i.e., in
51-
addition to the old -1, 0, 1, or 2). It takes an arbitrary number of
51+
addition to the old -1, 0, 1, or 2 that are respectively interpreted as 'stdname', 'calls', 'time', and 'cumulative'). It takes an arbitrary number of
5252
quoted strings to select the sort order. For example sort_stats('time',
5353
'name') sorts on the major key of 'internal function time', and on the
5454
minor key of 'the name of the function'. Look at the two tables in

0 commit comments

Comments
 (0)