summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-12-28 04:37:37 (GMT)
committerFred Drake <fdrake@acm.org>2001-12-28 04:37:37 (GMT)
commit9fcd9b2b1fa757bfff2c36a551f9f8935d08a0ce (patch)
tree3e3249e881f48c3c35f5d4c670a5d423b6fa33e3
parent3677d7e034a031f61b7ca507098b2190d18addef (diff)
downloadcpython-9fcd9b2b1fa757bfff2c36a551f9f8935d08a0ce.zip
cpython-9fcd9b2b1fa757bfff2c36a551f9f8935d08a0ce.tar.gz
cpython-9fcd9b2b1fa757bfff2c36a551f9f8935d08a0ce.tar.bz2
Added index entries similar to some recommended by Skip, and used the word
"interpolation" in the text, to make the string formatting material easier to find. This closes SF bug #487165.
-rw-r--r--Doc/lib/libstdtypes.tex20
1 files changed, 12 insertions, 8 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex
index a92928e..2ba87c4 100644
--- a/Doc/lib/libstdtypes.tex
+++ b/Doc/lib/libstdtypes.tex
@@ -681,20 +681,24 @@ Return a copy of the string converted to uppercase.
\subsubsection{String Formatting Operations \label{typesseq-strings}}
\index{formatting, string (\%{})}
+\index{interpolation, string (\%{})}
\index{string!formatting}
+\index{string!interpolation}
\index{printf-style formatting}
\index{sprintf-style formatting}
\index{\protect\%{} formatting}
+\index{\protect\%{} interpolation}
String and Unicode objects have one unique built-in operation: the
-\code{\%} operator (modulo). Given \code{\var{format} \%
-\var{values}} (where \var{format} is a string or Unicode object),
-\code{\%} conversion specifications in \var{format} are replaced with
-zero or more elements of \var{values}. The effect is similar to the
-using \cfunction{sprintf()} in the C language. If \var{format} is a
-Unicode object, or if any of the objects being converted using the
-\code{\%s} conversion are Unicode objects, the result will be a
-Unicode object as well.
+\code{\%} operator (modulo). This is also known as the string
+\emph{formatting} or \emph{interpolation} operator. Given
+\code{\var{format} \% \var{values}} (where \var{format} is a string or
+Unicode object), \code{\%} conversion specifications in \var{format}
+are replaced with zero or more elements of \var{values}. The effect
+is similar to the using \cfunction{sprintf()} in the C language. If
+\var{format} is a Unicode object, or if any of the objects being
+converted using the \code{\%s} conversion are Unicode objects, the
+result will be a Unicode object as well.
If \var{format} requires a single argument, \var{values} may be a
single non-tuple object. \footnote{A tuple object in this case should