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

Skip to content

Commit ab2dc1d

Browse files
committed
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. Bugfix: this should be applied for Python 2.2.1.
1 parent 3d42266 commit ab2dc1d

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

Doc/lib/libstdtypes.tex

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -681,20 +681,24 @@ \subsubsection{String Methods \label{string-methods}}
681681
\subsubsection{String Formatting Operations \label{typesseq-strings}}
682682

683683
\index{formatting, string (\%{})}
684+
\index{interpolation, string (\%{})}
684685
\index{string!formatting}
686+
\index{string!interpolation}
685687
\index{printf-style formatting}
686688
\index{sprintf-style formatting}
687689
\index{\protect\%{} formatting}
690+
\index{\protect\%{} interpolation}
688691

689692
String and Unicode objects have one unique built-in operation: the
690-
\code{\%} operator (modulo). Given \code{\var{format} \%
691-
\var{values}} (where \var{format} is a string or Unicode object),
692-
\code{\%} conversion specifications in \var{format} are replaced with
693-
zero or more elements of \var{values}. The effect is similar to the
694-
using \cfunction{sprintf()} in the C language. If \var{format} is a
695-
Unicode object, or if any of the objects being converted using the
696-
\code{\%s} conversion are Unicode objects, the result will be a
697-
Unicode object as well.
693+
\code{\%} operator (modulo). This is also known as the string
694+
\emph{formatting} or \emph{interpolation} operator. Given
695+
\code{\var{format} \% \var{values}} (where \var{format} is a string or
696+
Unicode object), \code{\%} conversion specifications in \var{format}
697+
are replaced with zero or more elements of \var{values}. The effect
698+
is similar to the using \cfunction{sprintf()} in the C language. If
699+
\var{format} is a Unicode object, or if any of the objects being
700+
converted using the \code{\%s} conversion are Unicode objects, the
701+
result will be a Unicode object as well.
698702

699703
If \var{format} requires a single argument, \var{values} may be a
700704
single non-tuple object. \footnote{A tuple object in this case should

0 commit comments

Comments
 (0)