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 laughingboy0
Recipients
Date 2006-10-24.15:57:03
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
class S(str):
   def __str__(self): return '__str__ overridden'

class U(unicode):
   def __str__(self): return '__str__ overridden'
   def __unicode__(self): return u'__unicode__ overridden'

s = S()
u = U()

print 's:', s
print "str(s):", str(s)
print 's substitued is "%s"\n' % s
print 'u:', u
print "str(u):", str(u)
print 'u substitued is "%s"' % u

-----------------------------------------------------

s: __str__ overridden
str(s): __str__ overridden
s substitued is "__str__ overridden"

u:
str(u): __str__ overridden
u substitued is ""

Results are identical for 2.4.2 and 2.5c2 (running
under windows).

History
Date User Action Args
2008-01-20 09:59:04adminlinkissue1583863 messages
2008-01-20 09:59:04admincreate