]> granicus.if.org Git - python/commitdiff
SF patch 664183 and SF bug 664044: Note that both u'%s' % 'x' and
authorRaymond Hettinger <python@rcn.com>
Mon, 13 Jan 2003 04:29:19 +0000 (04:29 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 13 Jan 2003 04:29:19 +0000 (04:29 +0000)
'%s' % u'x'  return a unicode object.

Doc/lib/libstdtypes.tex

index a3774269b8cc314fa47c26279609f80272ee4694..5f4a154c994643348517a0bf3c428b3f193c3b85 100644 (file)
@@ -834,7 +834,7 @@ The conversion types are:
   \lineiii{r}{String (converts any python object using
               \function{repr()}).}{(3)}
   \lineiii{s}{String (converts any python object using
-              \function{str()}).}{}
+              \function{str()}).}{(4)}
   \lineiii{\%}{No argument is converted, results in a \character{\%}
                character in the result.}{}
 \end{tableiii}
@@ -855,6 +855,9 @@ Notes:
     not already a zero.
   \item[(3)]
     The \code{\%r} conversion was added in Python 2.0.
+  \item[(4)]
+    If the object or format provided is a \class{unicode} string,
+    the resulting string will also be \class{unicode}.
 \end{description}
 
 % XXX Examples?