[issue7300] Unicode arguments in str.format()

STINNER Victor report at bugs.python.org
Sun Dec 30 22:49:10 CET 2012


STINNER Victor added the comment:

Another option is to decide that this issue will *not* be fixed in Python 2, and Python 3 *is* the good solution if you have this issue.

Doing the work twice can cause new problems, formatting an argument twice may return two different values :-( It may have an impact on performances and may introduce regressions.

Oh by the way, it's trivial to workaround this issue in Python 2: just use a Unicode format string. For example, replace '{0}'.format(u'\u3042') with u'{0}'.format(u'\u3042').

I hate implicit conversion from bytes to Unicode in Python 2, it's maybe better to not add a new special case?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7300>
_______________________________________


More information about the Python-bugs-list mailing list