Skip to content

Commit

Permalink
Mention abs(complex) -> magnitude (AMK).
Browse files Browse the repository at this point in the history
Documented list().
Mention [raw_]input()'s interface to GNU readline.
  • Loading branch information
gvanrossum committed Jun 2, 1997
1 parent 3a0d850 commit 921f32c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
21 changes: 18 additions & 3 deletions Doc/lib/libfuncs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ \section{Built-in Functions}
\renewcommand{\indexsubitem}{(built-in function)}
\begin{funcdesc}{abs}{x}
Return the absolute value of a number. The argument may be a plain
or long integer or a floating point number.
or long integer or a floating point number. If the argument is a
complex number, its magnitude is returned.
\end{funcdesc}

\begin{funcdesc}{apply}{function\, args\optional{, keywords}}
Expand Down Expand Up @@ -221,7 +222,8 @@ \section{Built-in Functions}

\begin{funcdesc}{input}{\optional{prompt}}
Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like
\code{raw_input()}, the \var{prompt} argument is optional. The difference
\code{raw_input()}, the \var{prompt} argument is optional, and GNU
readline is used when configured. The difference
is that a long input expression may be broken over multiple lines using
the backslash convention.
\end{funcdesc}
Expand Down Expand Up @@ -256,6 +258,15 @@ \section{Built-in Functions}
may be a sequence (string, tuple or list) or a mapping (dictionary).
\end{funcdesc}

\begin{funcdesc}{list}{sequence}
Return a list whose items are the same and in the same order as
\var{sequence}'s items. If \var{sequence} is already a list,
a copy is made and returned, similar to \code{\var{sequence}[:]}.
For instance, \code{list('abc')} returns
returns \code{['a', 'b', 'c']} and \code{list( (1, 2, 3) )} returns
\code{[1, 2, 3]}.
\end{funcdesc}

\begin{funcdesc}{locals}{}
Return a dictionary representing the current local symbol table.
Inside a function, modifying this dictionary does not always have the
Expand Down Expand Up @@ -400,6 +411,10 @@ \section{Built-in Functions}
"Monty Python's Flying Circus"
>>>
\end{verbatim}\ecode

If the interpreter was built to use the GNU readline library, then
\code{raw_input()} will use it to provide elaborate
line editing and history features.
\end{funcdesc}

\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}}
Expand Down Expand Up @@ -494,7 +509,7 @@ \section{Built-in Functions}

\begin{funcdesc}{tuple}{sequence}
Return a tuple whose items are the same and in the same order as
\var{sequence}'s items. If \var{sequence} is alread a tuple, it
\var{sequence}'s items. If \var{sequence} is already a tuple, it
is returned unchanged. For instance, \code{tuple('abc')} returns
returns \code{('a', 'b', 'c')} and \code{tuple([1, 2, 3])} returns
\code{(1, 2, 3)}.
Expand Down
21 changes: 18 additions & 3 deletions Doc/libfuncs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ \section{Built-in Functions}
\renewcommand{\indexsubitem}{(built-in function)}
\begin{funcdesc}{abs}{x}
Return the absolute value of a number. The argument may be a plain
or long integer or a floating point number.
or long integer or a floating point number. If the argument is a
complex number, its magnitude is returned.
\end{funcdesc}

\begin{funcdesc}{apply}{function\, args\optional{, keywords}}
Expand Down Expand Up @@ -221,7 +222,8 @@ \section{Built-in Functions}

\begin{funcdesc}{input}{\optional{prompt}}
Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like
\code{raw_input()}, the \var{prompt} argument is optional. The difference
\code{raw_input()}, the \var{prompt} argument is optional, and GNU
readline is used when configured. The difference
is that a long input expression may be broken over multiple lines using
the backslash convention.
\end{funcdesc}
Expand Down Expand Up @@ -256,6 +258,15 @@ \section{Built-in Functions}
may be a sequence (string, tuple or list) or a mapping (dictionary).
\end{funcdesc}

\begin{funcdesc}{list}{sequence}
Return a list whose items are the same and in the same order as
\var{sequence}'s items. If \var{sequence} is already a list,
a copy is made and returned, similar to \code{\var{sequence}[:]}.
For instance, \code{list('abc')} returns
returns \code{['a', 'b', 'c']} and \code{list( (1, 2, 3) )} returns
\code{[1, 2, 3]}.
\end{funcdesc}

\begin{funcdesc}{locals}{}
Return a dictionary representing the current local symbol table.
Inside a function, modifying this dictionary does not always have the
Expand Down Expand Up @@ -400,6 +411,10 @@ \section{Built-in Functions}
"Monty Python's Flying Circus"
>>>
\end{verbatim}\ecode

If the interpreter was built to use the GNU readline library, then
\code{raw_input()} will use it to provide elaborate
line editing and history features.
\end{funcdesc}

\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}}
Expand Down Expand Up @@ -494,7 +509,7 @@ \section{Built-in Functions}

\begin{funcdesc}{tuple}{sequence}
Return a tuple whose items are the same and in the same order as
\var{sequence}'s items. If \var{sequence} is alread a tuple, it
\var{sequence}'s items. If \var{sequence} is already a tuple, it
is returned unchanged. For instance, \code{tuple('abc')} returns
returns \code{('a', 'b', 'c')} and \code{tuple([1, 2, 3])} returns
\code{(1, 2, 3)}.
Expand Down

0 comments on commit 921f32c

Please sign in to comment.