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

Skip to content

Commit dff21a6

Browse files
committed
Minor nits.
Indent code sample to use 4-space indents.
1 parent 16a19c4 commit dff21a6

2 files changed

Lines changed: 30 additions & 34 deletions

File tree

Doc/lib/libdis.tex

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
\section{Standard Module \sectcode{dis}}
1+
\section{Standard Module \module{dis}}
22
\stmodindex{dis}
3-
43
\label{module-dis}
54

6-
The \code{dis} module supports the analysis of Python byte code by
5+
The \module{dis} module supports the analysis of Python byte code by
76
disassembling it. Since there is no Python assembler, this module
87
defines the Python assembly language. The Python byte code which
98
this module takes as an input is defined in the file
109
\file{Include/opcode.h} and used by the compiler and the interpreter.
1110

12-
Example: Given the function myfunc
11+
Example: Given the function \function{myfunc}:
1312

1413
\begin{verbatim}
1514
def myfunc(alist):
16-
return len(alist)
15+
return len(alist)
1716
\end{verbatim}
1817

19-
the following command can be used to get the disassembly of \code{myfunc()}:
18+
the following command can be used to get the disassembly of
19+
\function{myfunc()}:
2020

2121
\begin{verbatim}
2222
>>> dis.dis(myfunc)
@@ -31,9 +31,7 @@ \section{Standard Module \sectcode{dis}}
3131
19 RETURN_VALUE
3232
\end{verbatim}
3333

34-
The \code{dis} module defines the following functions:
35-
36-
\setindexsubitem{(in module dis)}
34+
The \module{dis} module defines the following functions:
3735

3836
\begin{funcdesc}{dis}{\optional{bytesource}}
3937
Disassemble the \var{bytesource} object. \var{bytesource} can denote
@@ -53,8 +51,8 @@ \section{Standard Module \sectcode{dis}}
5351
Disassembles a code object, indicating the last instruction if \var{lasti}
5452
was provided. The output is divided in the following columns:
5553
\begin{itemize}
56-
\item the current instruction, indicated as \code{-->},
57-
\item a labelled instruction, indicated with \code{>>},
54+
\item the current instruction, indicated as \samp{-->},
55+
\item a labelled instruction, indicated with \samp{>>},
5856
\item the address of the instruction,
5957
\item the operation code name,
6058
\item operation parameters, and
@@ -324,14 +322,14 @@ \subsection{Python Byte Code Instructions}
324322

325323
\begin{opcodedesc}{STORE_NAME}{namei}
326324
Implements \code{name = TOS}. \var{namei} is the index of \var{name}
327-
in the attribute \code{co_names} of the code object.
325+
in the attribute \member{co_names} of the code object.
328326
The compiler tries to use \code{STORE_LOCAL} or \code{STORE_GLOBAL}
329327
if possible.
330328
\end{opcodedesc}
331329

332330
\begin{opcodedesc}{DELETE_NAME}{namei}
333331
Implements \code{del name}, where \var{namei} is the index into
334-
\code{co_names} attribute of the code object.
332+
\member{co_names} attribute of the code object.
335333
\end{opcodedesc}
336334

337335
\begin{opcodedesc}{UNPACK_TUPLE}{count}
@@ -349,12 +347,12 @@ \subsection{Python Byte Code Instructions}
349347

350348
\begin{opcodedesc}{STORE_ATTR}{namei}
351349
Implements \code{TOS.name = TOS1}, where \var{namei} is the index
352-
of name in \code{co_names}.
350+
of name in \member{co_names}.
353351
\end{opcodedesc}
354352

355353
\begin{opcodedesc}{DELETE_ATTR}{namei}
356354
Implements \code{del TOS.name}, using \var{namei} as index into
357-
\code{co_names}.
355+
\member{co_names}.
358356
\end{opcodedesc}
359357

360358
\begin{opcodedesc}{STORE_GLOBAL}{namei}
@@ -370,11 +368,11 @@ \subsection{Python Byte Code Instructions}
370368
%\end{opcodedesc}
371369

372370
\begin{opcodedesc}{LOAD_CONST}{consti}
373-
Pushes \code{co_consts[\var{consti}]} onto the stack.
371+
Pushes \samp{co_consts[\var{consti}]} onto the stack.
374372
\end{opcodedesc}
375373

376374
\begin{opcodedesc}{LOAD_NAME}{namei}
377-
Pushes the value associated with \code{co_names[\var{namei}]} onto the stack.
375+
Pushes the value associated with \samp{co_names[\var{namei}]} onto the stack.
378376
\end{opcodedesc}
379377

380378
\begin{opcodedesc}{BUILD_TUPLE}{count}

Doc/libdis.tex

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
\section{Standard Module \sectcode{dis}}
1+
\section{Standard Module \module{dis}}
22
\stmodindex{dis}
3-
43
\label{module-dis}
54

6-
The \code{dis} module supports the analysis of Python byte code by
5+
The \module{dis} module supports the analysis of Python byte code by
76
disassembling it. Since there is no Python assembler, this module
87
defines the Python assembly language. The Python byte code which
98
this module takes as an input is defined in the file
109
\file{Include/opcode.h} and used by the compiler and the interpreter.
1110

12-
Example: Given the function myfunc
11+
Example: Given the function \function{myfunc}:
1312

1413
\begin{verbatim}
1514
def myfunc(alist):
16-
return len(alist)
15+
return len(alist)
1716
\end{verbatim}
1817

19-
the following command can be used to get the disassembly of \code{myfunc()}:
18+
the following command can be used to get the disassembly of
19+
\function{myfunc()}:
2020

2121
\begin{verbatim}
2222
>>> dis.dis(myfunc)
@@ -31,9 +31,7 @@ \section{Standard Module \sectcode{dis}}
3131
19 RETURN_VALUE
3232
\end{verbatim}
3333

34-
The \code{dis} module defines the following functions:
35-
36-
\setindexsubitem{(in module dis)}
34+
The \module{dis} module defines the following functions:
3735

3836
\begin{funcdesc}{dis}{\optional{bytesource}}
3937
Disassemble the \var{bytesource} object. \var{bytesource} can denote
@@ -53,8 +51,8 @@ \section{Standard Module \sectcode{dis}}
5351
Disassembles a code object, indicating the last instruction if \var{lasti}
5452
was provided. The output is divided in the following columns:
5553
\begin{itemize}
56-
\item the current instruction, indicated as \code{-->},
57-
\item a labelled instruction, indicated with \code{>>},
54+
\item the current instruction, indicated as \samp{-->},
55+
\item a labelled instruction, indicated with \samp{>>},
5856
\item the address of the instruction,
5957
\item the operation code name,
6058
\item operation parameters, and
@@ -324,14 +322,14 @@ \subsection{Python Byte Code Instructions}
324322

325323
\begin{opcodedesc}{STORE_NAME}{namei}
326324
Implements \code{name = TOS}. \var{namei} is the index of \var{name}
327-
in the attribute \code{co_names} of the code object.
325+
in the attribute \member{co_names} of the code object.
328326
The compiler tries to use \code{STORE_LOCAL} or \code{STORE_GLOBAL}
329327
if possible.
330328
\end{opcodedesc}
331329

332330
\begin{opcodedesc}{DELETE_NAME}{namei}
333331
Implements \code{del name}, where \var{namei} is the index into
334-
\code{co_names} attribute of the code object.
332+
\member{co_names} attribute of the code object.
335333
\end{opcodedesc}
336334

337335
\begin{opcodedesc}{UNPACK_TUPLE}{count}
@@ -349,12 +347,12 @@ \subsection{Python Byte Code Instructions}
349347

350348
\begin{opcodedesc}{STORE_ATTR}{namei}
351349
Implements \code{TOS.name = TOS1}, where \var{namei} is the index
352-
of name in \code{co_names}.
350+
of name in \member{co_names}.
353351
\end{opcodedesc}
354352

355353
\begin{opcodedesc}{DELETE_ATTR}{namei}
356354
Implements \code{del TOS.name}, using \var{namei} as index into
357-
\code{co_names}.
355+
\member{co_names}.
358356
\end{opcodedesc}
359357

360358
\begin{opcodedesc}{STORE_GLOBAL}{namei}
@@ -370,11 +368,11 @@ \subsection{Python Byte Code Instructions}
370368
%\end{opcodedesc}
371369

372370
\begin{opcodedesc}{LOAD_CONST}{consti}
373-
Pushes \code{co_consts[\var{consti}]} onto the stack.
371+
Pushes \samp{co_consts[\var{consti}]} onto the stack.
374372
\end{opcodedesc}
375373

376374
\begin{opcodedesc}{LOAD_NAME}{namei}
377-
Pushes the value associated with \code{co_names[\var{namei}]} onto the stack.
375+
Pushes the value associated with \samp{co_names[\var{namei}]} onto the stack.
378376
\end{opcodedesc}
379377

380378
\begin{opcodedesc}{BUILD_TUPLE}{count}

0 commit comments

Comments
 (0)