This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients Joshua.Landau, docs@python, eric.smith
Date 2014-05-21.14:21:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400682096.83.0.850451554067.issue21547@psf.upfronthosting.co.za>
In-reply-to
Content
I suggest using whatever language explains what "u'%s' %obj" does. It's the same behavior.

From the SO question, given:

class A(object):
    def __str__(self):
        return 'as str'

    def __unicode__(self):
        return u'as unicode'

Then:

>>> '%s' % A()
'as str'
>>> u'%s' % A()
u'as unicode'

and:

>>> '{!s}'.format(A())
'as str'
>>> u'{!s}'.format(A())
u'as unicode'
History
Date User Action Args
2014-05-21 14:21:36eric.smithsetrecipients: + eric.smith, docs@python, Joshua.Landau
2014-05-21 14:21:36eric.smithsetmessageid: <1400682096.83.0.850451554067.issue21547@psf.upfronthosting.co.za>
2014-05-21 14:21:36eric.smithlinkissue21547 messages
2014-05-21 14:21:36eric.smithcreate