[Python-Dev] unicode inconsistency? (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Thu Sep 9 20:42:38 CEST 2004


Aahz wrote:

It will work if 'A' subclasses from 'unicode' but should not be necessary, IMHO. Any reason why this shouldn't be fixed?

Check the recent python-dev archives for a long and nauseating thread about interactions between str and unicode.

Although that really doesn't answer this particular question. It was about str() and its interaction with str and unicode, and whether Python should support unicode.

For the specific issue, I would maintain that str() should always return string objects. I'm not so sure about %s since, as Neil observes, '%s' % unicode_string gives a unicode result. I can't see any harm by supporting this operation also if str returns a Unicode object.

Regards, Martin



More information about the Python-Dev mailing list