Commit be31705e authored by Fred Drake's avatar Fred Drake

Don't use \samp when \code is better.

Consistently use ' instead of ":  this conforms to my unofficial stance that
constants should be presented using the repr() whenever it makes sense.  This
isn't because I think repr() is the greatest thing since spam, just that it's
an easy to adopt consistency standard.  (It also holds no new surprises!)
parent 49e1ae34
...@@ -110,7 +110,7 @@ would add the following to your module: ...@@ -110,7 +110,7 @@ would add the following to your module:
\begin{verbatim} \begin{verbatim}
import profile import profile
profile.run("foo()") profile.run('foo()')
\end{verbatim} \end{verbatim}
% %
The above action would cause \samp{foo()} to be run, and a series of The above action would cause \samp{foo()} to be run, and a series of
...@@ -122,7 +122,7 @@ function: ...@@ -122,7 +122,7 @@ function:
\begin{verbatim} \begin{verbatim}
import profile import profile
profile.run("foo()", 'fooprof') profile.run('foo()', 'fooprof')
\end{verbatim} \end{verbatim}
% %
The file \file{profile.py} can also be invoked as The file \file{profile.py} can also be invoked as
...@@ -388,8 +388,8 @@ single function statistics. ...@@ -388,8 +388,8 @@ single function statistics.
\begin{methoddesc}{sort_stats}{key\optional{, ...}} \begin{methoddesc}{sort_stats}{key\optional{, ...}}
This method modifies the \class{Stats} object by sorting it according This method modifies the \class{Stats} object by sorting it according
to the supplied criteria. The argument is typically a string to the supplied criteria. The argument is typically a string
identifying the basis of a sort (example: \code{"time"} or identifying the basis of a sort (example: \code{'time'} or
\code{"name"}). \code{'name'}).
When more than one key is provided, then additional keys are used as When more than one key is provided, then additional keys are used as
secondary criteria when the there is equality in all keys selected secondary criteria when the there is equality in all keys selected
...@@ -417,18 +417,18 @@ defined: ...@@ -417,18 +417,18 @@ defined:
Note that all sorts on statistics are in descending order (placing Note that all sorts on statistics are in descending order (placing
most time consuming items first), where as name, file, and line number most time consuming items first), where as name, file, and line number
searches are in ascending order (i.e., alphabetical). The subtle searches are in ascending order (i.e., alphabetical). The subtle
distinction between \code{"nfl"} and \code{"stdname"} is that the distinction between \code{'nfl'} and \code{'stdname'} is that the
standard name is a sort of the name as printed, which means that the standard name is a sort of the name as printed, which means that the
embedded line numbers get compared in an odd way. For example, lines embedded line numbers get compared in an odd way. For example, lines
3, 20, and 40 would (if the file names were the same) appear in the 3, 20, and 40 would (if the file names were the same) appear in the
string order 20, 3 and 40. In contrast, \code{"nfl"} does a numeric string order 20, 3 and 40. In contrast, \code{'nfl'} does a numeric
compare of the line numbers. In fact, \code{sort_stats("nfl")} is the compare of the line numbers. In fact, \code{sort_stats('nfl')} is the
same as \code{sort_stats("name", "file", "line")}. same as \code{sort_stats('name', 'file', 'line')}.
For compatibility with the old profiler, the numeric arguments For compatibility with the old profiler, the numeric arguments
\samp{-1}, \samp{0}, \samp{1}, and \samp{2} are permitted. They are \code{-1}, \code{0}, \code{1}, and \code{2} are permitted. They are
interpreted as \code{"stdname"}, \code{"calls"}, \code{"time"}, and interpreted as \code{'stdname'}, \code{'calls'}, \code{'time'}, and
\code{"cumulative"} respectively. If this old style format (numeric) \code{'cumulative'} respectively. If this old style format (numeric)
is used, only one sort key (the numeric key) will be used, and is used, only one sort key (the numeric key) will be used, and
additional arguments will be silently ignored. additional arguments will be silently ignored.
\end{methoddesc} \end{methoddesc}
...@@ -461,7 +461,7 @@ defined by the \module{re} module). If several restrictions are ...@@ -461,7 +461,7 @@ defined by the \module{re} module). If several restrictions are
provided, then they are applied sequentially. For example: provided, then they are applied sequentially. For example:
\begin{verbatim} \begin{verbatim}
print_stats(.1, "foo:") print_stats(.1, 'foo:')
\end{verbatim} \end{verbatim}
would first limit the printing to first 10\% of list, and then only would first limit the printing to first 10\% of list, and then only
...@@ -469,7 +469,7 @@ print functions that were part of filename \samp{.*foo:}. In ...@@ -469,7 +469,7 @@ print functions that were part of filename \samp{.*foo:}. In
contrast, the command: contrast, the command:
\begin{verbatim} \begin{verbatim}
print_stats("foo:", .1) print_stats('foo:', .1)
\end{verbatim} \end{verbatim}
would limit the list to all functions having file names \samp{.*foo:}, would limit the list to all functions having file names \samp{.*foo:},
......
...@@ -110,7 +110,7 @@ would add the following to your module: ...@@ -110,7 +110,7 @@ would add the following to your module:
\begin{verbatim} \begin{verbatim}
import profile import profile
profile.run("foo()") profile.run('foo()')
\end{verbatim} \end{verbatim}
% %
The above action would cause \samp{foo()} to be run, and a series of The above action would cause \samp{foo()} to be run, and a series of
...@@ -122,7 +122,7 @@ function: ...@@ -122,7 +122,7 @@ function:
\begin{verbatim} \begin{verbatim}
import profile import profile
profile.run("foo()", 'fooprof') profile.run('foo()', 'fooprof')
\end{verbatim} \end{verbatim}
% %
The file \file{profile.py} can also be invoked as The file \file{profile.py} can also be invoked as
...@@ -388,8 +388,8 @@ single function statistics. ...@@ -388,8 +388,8 @@ single function statistics.
\begin{methoddesc}{sort_stats}{key\optional{, ...}} \begin{methoddesc}{sort_stats}{key\optional{, ...}}
This method modifies the \class{Stats} object by sorting it according This method modifies the \class{Stats} object by sorting it according
to the supplied criteria. The argument is typically a string to the supplied criteria. The argument is typically a string
identifying the basis of a sort (example: \code{"time"} or identifying the basis of a sort (example: \code{'time'} or
\code{"name"}). \code{'name'}).
When more than one key is provided, then additional keys are used as When more than one key is provided, then additional keys are used as
secondary criteria when the there is equality in all keys selected secondary criteria when the there is equality in all keys selected
...@@ -417,18 +417,18 @@ defined: ...@@ -417,18 +417,18 @@ defined:
Note that all sorts on statistics are in descending order (placing Note that all sorts on statistics are in descending order (placing
most time consuming items first), where as name, file, and line number most time consuming items first), where as name, file, and line number
searches are in ascending order (i.e., alphabetical). The subtle searches are in ascending order (i.e., alphabetical). The subtle
distinction between \code{"nfl"} and \code{"stdname"} is that the distinction between \code{'nfl'} and \code{'stdname'} is that the
standard name is a sort of the name as printed, which means that the standard name is a sort of the name as printed, which means that the
embedded line numbers get compared in an odd way. For example, lines embedded line numbers get compared in an odd way. For example, lines
3, 20, and 40 would (if the file names were the same) appear in the 3, 20, and 40 would (if the file names were the same) appear in the
string order 20, 3 and 40. In contrast, \code{"nfl"} does a numeric string order 20, 3 and 40. In contrast, \code{'nfl'} does a numeric
compare of the line numbers. In fact, \code{sort_stats("nfl")} is the compare of the line numbers. In fact, \code{sort_stats('nfl')} is the
same as \code{sort_stats("name", "file", "line")}. same as \code{sort_stats('name', 'file', 'line')}.
For compatibility with the old profiler, the numeric arguments For compatibility with the old profiler, the numeric arguments
\samp{-1}, \samp{0}, \samp{1}, and \samp{2} are permitted. They are \code{-1}, \code{0}, \code{1}, and \code{2} are permitted. They are
interpreted as \code{"stdname"}, \code{"calls"}, \code{"time"}, and interpreted as \code{'stdname'}, \code{'calls'}, \code{'time'}, and
\code{"cumulative"} respectively. If this old style format (numeric) \code{'cumulative'} respectively. If this old style format (numeric)
is used, only one sort key (the numeric key) will be used, and is used, only one sort key (the numeric key) will be used, and
additional arguments will be silently ignored. additional arguments will be silently ignored.
\end{methoddesc} \end{methoddesc}
...@@ -461,7 +461,7 @@ defined by the \module{re} module). If several restrictions are ...@@ -461,7 +461,7 @@ defined by the \module{re} module). If several restrictions are
provided, then they are applied sequentially. For example: provided, then they are applied sequentially. For example:
\begin{verbatim} \begin{verbatim}
print_stats(.1, "foo:") print_stats(.1, 'foo:')
\end{verbatim} \end{verbatim}
would first limit the printing to first 10\% of list, and then only would first limit the printing to first 10\% of list, and then only
...@@ -469,7 +469,7 @@ print functions that were part of filename \samp{.*foo:}. In ...@@ -469,7 +469,7 @@ print functions that were part of filename \samp{.*foo:}. In
contrast, the command: contrast, the command:
\begin{verbatim} \begin{verbatim}
print_stats("foo:", .1) print_stats('foo:', .1)
\end{verbatim} \end{verbatim}
would limit the list to all functions having file names \samp{.*foo:}, would limit the list to all functions having file names \samp{.*foo:},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment