summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libfuncs.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-02-13 06:58:54 (GMT)
committerFred Drake <fdrake@acm.org>1998-02-13 06:58:54 (GMT)
commit1947991c2f85db781fb3fcdc9e3bcfe2905e58e2 (patch)
tree260789493c7151408f009eaa84a7815ce4d28246 /Doc/lib/libfuncs.tex
parentdc8af0acc1fbeec89e43f1ea43bf1a4d016f4fc6 (diff)
downloadcpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.zip
cpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.tar.gz
cpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.tar.bz2
Remove all \bcode / \ecode cruft; this is no longer needed. See previous
checkin of myformat.sty. Change "\renewcommand{\indexsubitem}{(...)}" to "\setindexsubitem{(...)}" everywhere. Some other minor nits that I happened to come across.
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r--Doc/lib/libfuncs.tex22
1 files changed, 11 insertions, 11 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index 6d1cbce..6a2b0a5 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -5,7 +5,7 @@ The Python interpreter has a number of functions built into it that
are always available. They are listed here in alphabetical order.
-\renewcommand{\indexsubitem}{(built-in function)}
+\setindexsubitem{(built-in function)}
\begin{funcdesc}{__import__}{name\optional{, globals\optional{, locals\optional{, fromlist}}}}
This function is invoked by the \code{import} statement. It
@@ -135,14 +135,14 @@ class instances are callable if they have an attribute \code{__call__}.
and for class instances, methods are not included.
The resulting list is sorted alphabetically. For example:
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> import sys
>>> dir()
['sys']
>>> dir(sys)
['argv', 'exit', 'modules', 'path', 'stderr', 'stdin', 'stdout']
>>>
-\end{verbatim}\ecode
+\end{verbatim}
\end{funcdesc}
\begin{funcdesc}{divmod}{a\, b}
@@ -166,12 +166,12 @@ class instances are callable if they have an attribute \code{__call__}.
called. The return value is the result of the evaluated expression.
Syntax errors are reported as exceptions. Example:
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> x = 1
>>> print eval('x+1')
2
>>>
-\end{verbatim}\ecode
+\end{verbatim}
%
This function can also be used to execute arbitrary code objects
(e.g.\ created by \code{compile()}). In this case pass a code
@@ -448,7 +448,7 @@ there's no reliable way to determine whether this is the case.}
greater than \var{stop}. \var{step} must not be zero (or else an
exception is raised). Example:
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> range(1, 11)
@@ -464,7 +464,7 @@ there's no reliable way to determine whether this is the case.}
>>> range(1, 0)
[]
>>>
-\end{verbatim}\ecode
+\end{verbatim}
\end{funcdesc}
\begin{funcdesc}{raw_input}{\optional{prompt}}
@@ -473,13 +473,13 @@ there's no reliable way to determine whether this is the case.}
converts it to a string (stripping a trailing newline), and returns that.
When \EOF{} is read, \code{EOFError} is raised. Example:
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> s = raw_input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"
>>>
-\end{verbatim}\ecode
+\end{verbatim}
If the \code{readline} module was loaded, then
\code{raw_input()} will use it to provide elaborate
@@ -604,10 +604,10 @@ built-in types.
\obindex{type}
For instance:
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> import types
>>> if isinstance(x, types.StringType): print "It's a string"
-\end{verbatim}\ecode
+\end{verbatim}
\end{funcdesc}
\begin{funcdesc}{vars}{\optional{object}}