unicode bit me

anuraguniyal at yahoo.com anuraguniyal at yahoo.com
Sat May 9 11:37:59 EDT 2009


Sorry being unclear again, hmm I am becoming an expert in it.

I pasted that code as continuation of my old code at start
i.e
 class A(object):
     def __unicode__(self):
         return u"©au"

     def __repr__(self):
         return unicode(self).encode("utf-8")
     __str__ = __repr__

doesn't work means throws unicode error
my question boils down to
what is diff between, why one doesn't throws error and another does
print unicode(a)
vs
print unicode([a])




More information about the Python-list mailing list