[Python-Dev] String formatting / unicode 2.5 bug?

John J Lee jjl at pobox.com
Sun Aug 20 02:27:10 CEST 2006


Is this a bug?

# run with 2.4 and then with 2.5 (I'm running release25-maint:51410)
class a(object):

     def __getattribute__(self, name):
         print "accessing %r.%s" % (self, name)
         return object.__getattribute__(self, name)

     def __str__(self):
         print "__str__"
         return u'hi'

print repr(str(a()))
print
print repr("%s" % a())


John



More information about the Python-Dev mailing list