"%s" vs unicode

Robin Becker robin at jessikat.fsnet.co.uk
Tue Jan 7 19:59:56 EST 2003


In article <loKS9.175$467.90 at fe08>, Steve Holden <sholden at holdenweb.com>
writes
......
>Well, there's also a widening principle that you seem to be ignoring. In the
>same way that int+float gives float, and float*complex gives complex, so any
>string operation involving a Unicode operation gives a Unicode result.
>
>Otherwise what would you have Python do with non-translatable Unicode
>characters it has to handle in a %s substitution? Give an ordinal value
>error?
>
>regards
......I'm not really disagreeing. The widening here just seems wrong. If
"x" op y --> unicode/string why can't "x" op z --> complex for some
specific values of x & z. Normally Python tries to be simple, but if
unicode is a widened string why doesn't raise u'A' work? Widening should
work reasonably if we are going to have a concensus on what is
reasonable.
-- 
Robin Becker




More information about the Python-list mailing list