Message218876
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' |
|
Date |
User |
Action |
Args |
2014-05-21 14:21:36 | eric.smith | set | recipients:
+ eric.smith, docs@python, Joshua.Landau |
2014-05-21 14:21:36 | eric.smith | set | messageid: <1400682096.83.0.850451554067.issue21547@psf.upfronthosting.co.za> |
2014-05-21 14:21:36 | eric.smith | link | issue21547 messages |
2014-05-21 14:21:36 | eric.smith | create | |
|