[Python-checkins] CVS: python/dist/src/Doc/lib libarray.tex,1.29,1.29.2.1 libre.tex,1.63.2.1,1.63.2.2 libreadline.tex,1.5,1.5.8.1
Tim Peters
tim_one@users.sourceforge.net
Wed, 01 Aug 2001 19:40:44 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Doc/lib
Modified Files:
Tag: descr-branch
libarray.tex libre.tex libreadline.tex
Log Message:
Mrege of trunk tag delta date2001-07-30 to date2001-08-01.
Index: libarray.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libarray.tex,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -C2 -d -r1.29 -r1.29.2.1
*** libarray.tex 2001/07/06 19:28:48 1.29
--- libarray.tex 2001/08/02 02:40:42 1.29.2.1
***************
*** 69,78 ****
\begin{methoddesc}[array]{buffer_info}{}
Return a tuple \code{(\var{address}, \var{length})} giving the current
! memory address and the length in bytes of the buffer used to hold
! array's contents. This is occasionally useful when working with
low-level (and inherently unsafe) I/O interfaces that require memory
! addresses, such as certain \cfunction{ioctl()} operations. The returned
! numbers are valid as long as the array exists and no length-changing
! operations are applied to it.
\end{methoddesc}
--- 69,87 ----
\begin{methoddesc}[array]{buffer_info}{}
Return a tuple \code{(\var{address}, \var{length})} giving the current
! memory address and the length in elements of the buffer used to hold
! array's contents. The size of the memory buffer in bytes can be
! computed as \code{\var{array}.buffer_info()[1] *
! \var{array}.itemsize}. This is occasionally useful when working with
low-level (and inherently unsafe) I/O interfaces that require memory
! addresses, such as certain \cfunction{ioctl()} operations. The
! returned numbers are valid as long as the array exists and no
! length-changing operations are applied to it.
!
! \strong{Note:} When using array objects from code written in C or
! \Cpp{} (the only way to effectively make use of this information), it
! makes more sense to use the buffer interface supported by array
! objects. This method is maintained for backward compatibility and
! should be avoided in new code. The buffer interface is documented in
! the \citetitle[../api/newTypes.html]{Python/C API Reference Manual}.
\end{methoddesc}
***************
*** 175,179 ****
an array with the same type and value using reverse quotes
(\code{``}), so long as the \function{array()} function has been
! imported using \samp{from array import array}. Examples:
\begin{verbatim}
--- 184,188 ----
an array with the same type and value using reverse quotes
(\code{``}), so long as the \function{array()} function has been
! imported using \code{from array import array}. Examples:
\begin{verbatim}
Index: libre.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v
retrieving revision 1.63.2.1
retrieving revision 1.63.2.2
diff -C2 -d -r1.63.2.1 -r1.63.2.2
*** libre.tex 2001/07/28 05:02:58 1.63.2.1
--- libre.tex 2001/08/02 02:40:42 1.63.2.2
***************
*** 129,137 ****
in the previous expression will match only \code{'<H1>'}.
\item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from
\var{m} to \var{n} repetitions of the preceding RE, attempting to
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
will match from 3 to 5 \character{a} characters. Omitting \var{n}
! specifies an infinite upper bound; you can't omit \var{m}.
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to
--- 129,145 ----
in the previous expression will match only \code{'<H1>'}.
+ \item[\code{\{\var{m}\}}]
+ Specifies that exactly \var{m} copies of the previous RE should be
+ matched; fewer matches cause the entire RE not to match. For example,
+ \regexp{a\{6\}} will match exactly six \character{a} characters, but
+ not five.
+
\item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from
\var{m} to \var{n} repetitions of the preceding RE, attempting to
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
will match from 3 to 5 \character{a} characters. Omitting \var{n}
! specifies an infinite upper bound; you can't omit \var{m}. The comma
! may not be omitted or the modifier would be confused with the
! previously described form.
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to
***************
*** 498,516 ****
\begin{funcdesc}{findall}{pattern, string}
! Return a list of all non-overlapping matches of \var{pattern} in
! \var{string}. If one or more groups are present in the pattern,
! return a list of groups; this will be a list of tuples if the pattern
! has more than one group. Empty matches are included in the result.
! \versionadded{1.5.2}
\end{funcdesc}
! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count\code{ = 0}}}
! Return the string obtained by replacing the leftmost non-overlapping
! occurrences of \var{pattern} in \var{string} by the replacement
! \var{repl}. If the pattern isn't found, \var{string} is returned
! unchanged. \var{repl} can be a string or a function; if a function,
! it is called for every non-overlapping occurrence of \var{pattern}.
! The function takes a single match object argument, and returns the
! replacement string. For example:
\begin{verbatim}
--- 506,539 ----
\begin{funcdesc}{findall}{pattern, string}
! Return a list of all non-overlapping matches of \var{pattern} in
! \var{string}. If one or more groups are present in the pattern,
! return a list of groups; this will be a list of tuples if the
! pattern has more than one group. Empty matches are included in the
! result.
! \versionadded{1.5.2}
\end{funcdesc}
! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count}}
! Return the string obtained by replacing the leftmost non-overlapping
! occurrences of \var{pattern} in \var{string} by the replacement
! \var{repl}. If the pattern isn't found, \var{string} is returned
! unchanged. \var{repl} can be a string or a function; if it is a
! string, any backslash escapes in it are processed. That is,
! \samp{\e n} is converted to a single newline character, \samp{\e r}
! is converted to a linefeed, and so forth. Unknown escapes such as
! \samp{\e j} are left alone. Backreferences, such as \samp{\e6}, are
! replaced with the substring matched by group 6 in the pattern. For
! example:
!
! \begin{verbatim}
! >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):',
! ... r'static PyObject*\npy_\1(void)\n{',
! ... 'def myfunc():')
! 'static PyObject*\npy_myfunc(void)\n{'
! \end{verbatim}
!
! If \var{repl} is a function, it is called for every non-overlapping
! occurrence of \var{pattern}. The function takes a single match
! object argument, and returns the replacement string. For example:
\begin{verbatim}
***************
*** 522,557 ****
\end{verbatim}
! The pattern may be a string or an RE object; if you need to specify
! regular expression flags, you must use a RE object, or use
! embedded modifiers in a pattern; for example,
! \samp{sub("(?i)b+", "x", "bbbb BBBB")} returns \code{'x x'}.
!
! The optional argument \var{count} is the maximum number of pattern
! occurrences to be replaced; \var{count} must be a non-negative
! integer, and the default value of 0 means to replace all occurrences.
!
! Empty matches for the pattern are replaced only when not adjacent to a
! previous match, so \samp{sub('x*', '-', 'abc')} returns
! \code{'-a-b-c-'}.
! If \var{repl} is a string, any backslash escapes in it are processed.
! That is, \samp{\e n} is converted to a single newline character,
! \samp{\e r} is converted to a linefeed, and so forth. Unknown escapes
! such as \samp{\e j} are left alone. Backreferences, such as \samp{\e
! 6}, are replaced with the substring matched by group 6 in the pattern.
! In addition to character escapes and backreferences as described
! above, \samp{\e g<name>} will use the substring matched by the group
! named \samp{name}, as defined by the \regexp{(?P<name>...)} syntax.
! \samp{\e g<number>} uses the corresponding group number; \samp{\e
! g<2>} is therefore equivalent to \samp{\e 2}, but isn't ambiguous in a
! replacement such as \samp{\e g<2>0}. \samp{\e 20} would be
! interpreted as a reference to group 20, not a reference to group 2
! followed by the literal character \character{0}.
\end{funcdesc}
! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count\code{ = 0}}}
! Perform the same operation as \function{sub()}, but return a tuple
! \code{(\var{new_string}, \var{number_of_subs_made})}.
\end{funcdesc}
--- 545,573 ----
\end{verbatim}
! The pattern may be a string or an RE object; if you need to specify
! regular expression flags, you must use a RE object, or use embedded
! modifiers in a pattern; for example, \samp{sub("(?i)b+", "x", "bbbb
! BBBB")} returns \code{'x x'}.
! The optional argument \var{count} is the maximum number of pattern
! occurrences to be replaced; \var{count} must be a non-negative
! integer. If omitted or zero, all occurrences will be replaced.
! Empty matches for the pattern are replaced only when not adjacent to
! a previous match, so \samp{sub('x*', '-', 'abc')} returns
! \code{'-a-b-c-'}.
! In addition to character escapes and backreferences as described
! above, \samp{\e g<name>} will use the substring matched by the group
! named \samp{name}, as defined by the \regexp{(?P<name>...)} syntax.
! \samp{\e g<number>} uses the corresponding group number;
! \samp{\e g<2>} is therefore equivalent to \samp{\e 2}, but isn't
! ambiguous in a replacement such as \samp{\e g<2>0}. \samp{\e 20}
! would be interpreted as a reference to group 20, not a reference to
! group 2 followed by the literal character \character{0}.
\end{funcdesc}
! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count}}
! Perform the same operation as \function{sub()}, but return a tuple
! \code{(\var{new_string}, \var{number_of_subs_made})}.
\end{funcdesc}
Index: libreadline.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libreadline.tex,v
retrieving revision 1.5
retrieving revision 1.5.8.1
diff -C2 -d -r1.5 -r1.5.8.1
*** libreadline.tex 2000/10/10 17:03:45 1.5
--- libreadline.tex 2001/08/02 02:40:42 1.5.8.1
***************
*** 56,63 ****
\begin{funcdesc}{set_completer}{\optional{function}}
! Set or remove the completer function. The completer function is
! called as \code{\var{function}(\var{text}, \var{state})},
! \code{for i in [0, 1, 2, ...]} until it returns a non-string.
! It should return the next possible completion starting with \var{text}.
\end{funcdesc}
--- 56,66 ----
\begin{funcdesc}{set_completer}{\optional{function}}
! Set or remove the completer function. If \var{function} is specified,
! it will be used as the new completer function; if omitted or
! \code{None}, any completer function already installed is removed. The
! completer function is called as \code{\var{function}(\var{text},
! \var{state})}, for \var{state} in \code{0}, \code{1}, \code{2}, ...,
! until it returns a non-string value. It should return the next
! possible completion starting with \var{text}.
\end{funcdesc}