[Python-Dev] Re: [Patches] Unicode Patch Set 2000-04-10

Greg Stein gstein@lyra.org
Mon, 10 Apr 2000 02:53:48 -0700 (PDT)


On Mon, 10 Apr 2000, M.-A. Lemburg wrote:
> The attached patch includes the following fixes and additions:
>...
> * '...%s...' % u"abc" now coerces to Unicode just like 
>   string methods. Care is taken not to reevaluate already formatted
>   arguments -- only the first Unicode object appearing in the
>   argument mapping is looked up twice. Added test cases for
>   this to test_unicode.py.
>...

I missed a chance to bring this up on the first round of discussion, but
is this really the right thing to do? We never coerce the string on the
left based on operands. For example: if the operands are class instances,
we call __str__ -- we don't call __coerce__.

It seems a bit weird to magically revise the left operand.

In many cases, a Unicode used as a string is used as a UTF-8 value. Why is
that different in this case? Seems like a wierd special case.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/