Message100769
PyString_Format() uses a "goto unicode;" if a '%c' or '%s' argument is unicode. The unicode label converts the partial formatted result (byte string) to unicode, and use PyUnicode_Format() to finish to formatting.
I don't think that you can apply the same algorithm here (converts the partial result to unicode) because it requires to rewrite the format string: arguments can be used twice or more, and used in any order.
Example: "{0} {1}".format("bytes", u"unicode") => switch to unicode occurs at result="bytes ", format=" {1}", arguments=(u"unicode"). Converts "bytes " to unicode is easy, but the format have to be rewritten in " {0}" or something else.
Call trace of str.format(): do_string_format() -> build_string() -> output_markup() -> render_field(). The argument type is proceed in render_field(). |
|
Date |
User |
Action |
Args |
2010-03-09 22:57:48 | vstinner | set | recipients:
+ vstinner, doerwalter, eric.smith, ezio.melotti, pablomouzo |
2010-03-09 22:57:47 | vstinner | set | messageid: <1268175467.92.0.848495415813.issue7300@psf.upfronthosting.co.za> |
2010-03-09 22:57:46 | vstinner | link | issue7300 messages |
2010-03-09 22:57:45 | vstinner | create | |
|