diff -r 5e24816e13a3 -r fd39bf7dc81c Doc/library/profile.rst --- a/Doc/library/profile.rst Mon Oct 08 10:42:22 2012 +0200 +++ b/Doc/library/profile.rst Mon Oct 08 16:50:19 2012 +0200 @@ -231,15 +231,16 @@ reading the source code for these modules. -.. function:: run(command[, filename]) +.. function:: run(command[, filename][, sort]) This function takes a single argument that can be passed to the - :keyword:`exec` statement, and an optional file name. In all cases this - routine attempts to :keyword:`exec` its first argument, and gather profiling - statistics from the execution. If no file name is present, then this function - automatically prints a simple profiling report, sorted by the standard name - string (file/line/function-name) that is presented in each line. The - following is a typical output from such a call:: + :keyword:`exec` statement, and optionally a file name and a sorting + directive. In all cases this routine attempts to :keyword:`exec` + its first argument, and gather profiling statistics from the + execution. If no file name is present, then this function + automatically prints a simple profiling report, sorted by the + standard name string (file/line/function-name) that is presented in + each line. The following is a typical output from such a call:: 2706 function calls (2004 primitive calls) in 4.504 CPU seconds @@ -279,7 +280,8 @@ When there are two numbers in the first column (for example, ``43/3``), then the latter is the number of primitive calls, and the former is the actual number of calls. Note that when the function does not recurse, these two values are the - same, and only the single figure is printed. + same, and only the single figure is printed. For information on the sort + argument, refer to :meth:`pstats.Stats.sort_stats`. .. function:: runctx(command, globals, locals[, filename])