[issue8128] String interpolation with unicode subclass fails to call __str__

Georg Brandl report at bugs.python.org
Tue Apr 27 09:09:24 CEST 2010


Georg Brandl <georg at python.org> added the comment:

In Python 2.x, __unicode__ is called instead of __str__.  Whether that's "correct" behavior, I'm not sure, but at least it is consistent with "{}".format(K()).

In Python 3.x, __unicode__ doesn't exist and __str__ isn't called; but for "{}".format(K()), it is.  Therefore I think here a fix should be made in any case.

Benjamin, what do you think?

----------
assignee:  -> benjamin.peterson
nosy: +benjamin.peterson, georg.brandl

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


More information about the Python-bugs-list mailing list