On 5/24/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> so, which one is correct ?
>
> Python 2.4.3
> >>> "".replace("", "a")
> ''
> >>> u"".replace(u"", u"a")
> u'a'
Since 'x'.replace('', 'a') and u'x'.replace('', u'a') return 'axa' and
u'axa', respectively, I conclude that the unicode version is correct
and the 8-bit string version is an anomaly.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com