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

Skip to content

Commit 2bd1568

Browse files
committed
SF patch 664183 and SF bug 664044: Note that both u'%s' % 'x' and
'%s' % u'x' return a unicode object.
1 parent bc65521 commit 2bd1568

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/lib/libstdtypes.tex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ \subsubsection{String Formatting Operations \label{typesseq-strings}}
834834
\lineiii{r}{String (converts any python object using
835835
\function{repr()}).}{(3)}
836836
\lineiii{s}{String (converts any python object using
837-
\function{str()}).}{}
837+
\function{str()}).}{(4)}
838838
\lineiii{\%}{No argument is converted, results in a \character{\%}
839839
character in the result.}{}
840840
\end{tableiii}
@@ -855,6 +855,9 @@ \subsubsection{String Formatting Operations \label{typesseq-strings}}
855855
not already a zero.
856856
\item[(3)]
857857
The \code{\%r} conversion was added in Python 2.0.
858+
\item[(4)]
859+
If the object or format provided is a \class{unicode} string,
860+
the resulting string will also be \class{unicode}.
858861
\end{description}
859862

860863
% XXX Examples?

0 commit comments

Comments
 (0)