"%s" vs unicode

Neal Norwitz neal at metaslash.com
Wed Jan 8 03:00:37 CET 2003


On Tue, 07 Jan 2003 19:59:56 -0500, Robin Becker wrote:

> 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.
>>
> ......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.
 
Raising strings as exceptions is deprecated.  So there isn't much point
in allowing unicode exceptions.

Neal




More information about the Python-list mailing list