Unicode with win32com and makepy

Martin v. Loewis martin at v.loewis.de
Sat Mar 30 03:34:04 EST 2002


Tim Roberts <timr at probo.com> writes:

> Here's the question: what do we do in the long term?  Should makepy
> generate a __unicode__ member every time it generates a __str__ member?

I think so, although it could probably phrase that as

         def __unicode__(self, *args):
                 try:
                         return unicode(self.__call__(*args))
                 except pythoncom.com_error:
                         return repr(self)

        def __str__(self, *args):
                 return str(unicode(self, *args))

What is the set of types that __call__ can return?

Regards,
Martin



More information about the Python-list mailing list