Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cb824c

Browse files
committed
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!)
1 parent 5cca42e commit 2cb824c

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

Doc/lib/libprofile.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ \section{Instant Users Manual}
110110

111111
\begin{verbatim}
112112
import profile
113-
profile.run("foo()")
113+
profile.run('foo()')
114114
\end{verbatim}
115115
%
116116
The above action would cause \samp{foo()} to be run, and a series of
@@ -122,7 +122,7 @@ \section{Instant Users Manual}
122122

123123
\begin{verbatim}
124124
import profile
125-
profile.run("foo()", 'fooprof')
125+
profile.run('foo()', 'fooprof')
126126
\end{verbatim}
127127
%
128128
The file \file{profile.py} can also be invoked as
@@ -388,8 +388,8 @@ \subsection{The \module{Stats} Class}
388388
\begin{methoddesc}{sort_stats}{key\optional{, ...}}
389389
This method modifies the \class{Stats} object by sorting it according
390390
to the supplied criteria. The argument is typically a string
391-
identifying the basis of a sort (example: \code{"time"} or
392-
\code{"name"}).
391+
identifying the basis of a sort (example: \code{'time'} or
392+
\code{'name'}).
393393

394394
When more than one key is provided, then additional keys are used as
395395
secondary criteria when the there is equality in all keys selected
@@ -417,18 +417,18 @@ \subsection{The \module{Stats} Class}
417417
Note that all sorts on statistics are in descending order (placing
418418
most time consuming items first), where as name, file, and line number
419419
searches are in ascending order (i.e., alphabetical). The subtle
420-
distinction between \code{"nfl"} and \code{"stdname"} is that the
420+
distinction between \code{'nfl'} and \code{'stdname'} is that the
421421
standard name is a sort of the name as printed, which means that the
422422
embedded line numbers get compared in an odd way. For example, lines
423423
3, 20, and 40 would (if the file names were the same) appear in the
424-
string order 20, 3 and 40. In contrast, \code{"nfl"} does a numeric
425-
compare of the line numbers. In fact, \code{sort_stats("nfl")} is the
426-
same as \code{sort_stats("name", "file", "line")}.
424+
string order 20, 3 and 40. In contrast, \code{'nfl'} does a numeric
425+
compare of the line numbers. In fact, \code{sort_stats('nfl')} is the
426+
same as \code{sort_stats('name', 'file', 'line')}.
427427

428428
For compatibility with the old profiler, the numeric arguments
429-
\samp{-1}, \samp{0}, \samp{1}, and \samp{2} are permitted. They are
430-
interpreted as \code{"stdname"}, \code{"calls"}, \code{"time"}, and
431-
\code{"cumulative"} respectively. If this old style format (numeric)
429+
\code{-1}, \code{0}, \code{1}, and \code{2} are permitted. They are
430+
interpreted as \code{'stdname'}, \code{'calls'}, \code{'time'}, and
431+
\code{'cumulative'} respectively. If this old style format (numeric)
432432
is used, only one sort key (the numeric key) will be used, and
433433
additional arguments will be silently ignored.
434434
\end{methoddesc}
@@ -461,15 +461,15 @@ \subsection{The \module{Stats} Class}
461461
provided, then they are applied sequentially. For example:
462462

463463
\begin{verbatim}
464-
print_stats(.1, "foo:")
464+
print_stats(.1, 'foo:')
465465
\end{verbatim}
466466

467467
would first limit the printing to first 10\% of list, and then only
468468
print functions that were part of filename \samp{.*foo:}. In
469469
contrast, the command:
470470

471471
\begin{verbatim}
472-
print_stats("foo:", .1)
472+
print_stats('foo:', .1)
473473
\end{verbatim}
474474

475475
would limit the list to all functions having file names \samp{.*foo:},

Doc/libprofile.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ \section{Instant Users Manual}
110110

111111
\begin{verbatim}
112112
import profile
113-
profile.run("foo()")
113+
profile.run('foo()')
114114
\end{verbatim}
115115
%
116116
The above action would cause \samp{foo()} to be run, and a series of
@@ -122,7 +122,7 @@ \section{Instant Users Manual}
122122

123123
\begin{verbatim}
124124
import profile
125-
profile.run("foo()", 'fooprof')
125+
profile.run('foo()', 'fooprof')
126126
\end{verbatim}
127127
%
128128
The file \file{profile.py} can also be invoked as
@@ -388,8 +388,8 @@ \subsection{The \module{Stats} Class}
388388
\begin{methoddesc}{sort_stats}{key\optional{, ...}}
389389
This method modifies the \class{Stats} object by sorting it according
390390
to the supplied criteria. The argument is typically a string
391-
identifying the basis of a sort (example: \code{"time"} or
392-
\code{"name"}).
391+
identifying the basis of a sort (example: \code{'time'} or
392+
\code{'name'}).
393393

394394
When more than one key is provided, then additional keys are used as
395395
secondary criteria when the there is equality in all keys selected
@@ -417,18 +417,18 @@ \subsection{The \module{Stats} Class}
417417
Note that all sorts on statistics are in descending order (placing
418418
most time consuming items first), where as name, file, and line number
419419
searches are in ascending order (i.e., alphabetical). The subtle
420-
distinction between \code{"nfl"} and \code{"stdname"} is that the
420+
distinction between \code{'nfl'} and \code{'stdname'} is that the
421421
standard name is a sort of the name as printed, which means that the
422422
embedded line numbers get compared in an odd way. For example, lines
423423
3, 20, and 40 would (if the file names were the same) appear in the
424-
string order 20, 3 and 40. In contrast, \code{"nfl"} does a numeric
425-
compare of the line numbers. In fact, \code{sort_stats("nfl")} is the
426-
same as \code{sort_stats("name", "file", "line")}.
424+
string order 20, 3 and 40. In contrast, \code{'nfl'} does a numeric
425+
compare of the line numbers. In fact, \code{sort_stats('nfl')} is the
426+
same as \code{sort_stats('name', 'file', 'line')}.
427427

428428
For compatibility with the old profiler, the numeric arguments
429-
\samp{-1}, \samp{0}, \samp{1}, and \samp{2} are permitted. They are
430-
interpreted as \code{"stdname"}, \code{"calls"}, \code{"time"}, and
431-
\code{"cumulative"} respectively. If this old style format (numeric)
429+
\code{-1}, \code{0}, \code{1}, and \code{2} are permitted. They are
430+
interpreted as \code{'stdname'}, \code{'calls'}, \code{'time'}, and
431+
\code{'cumulative'} respectively. If this old style format (numeric)
432432
is used, only one sort key (the numeric key) will be used, and
433433
additional arguments will be silently ignored.
434434
\end{methoddesc}
@@ -461,15 +461,15 @@ \subsection{The \module{Stats} Class}
461461
provided, then they are applied sequentially. For example:
462462

463463
\begin{verbatim}
464-
print_stats(.1, "foo:")
464+
print_stats(.1, 'foo:')
465465
\end{verbatim}
466466

467467
would first limit the printing to first 10\% of list, and then only
468468
print functions that were part of filename \samp{.*foo:}. In
469469
contrast, the command:
470470

471471
\begin{verbatim}
472-
print_stats("foo:", .1)
472+
print_stats('foo:', .1)
473473
\end{verbatim}
474474

475475
would limit the list to all functions having file names \samp{.*foo:},

0 commit comments

Comments
 (0)