Jacek Pliszka wrote: > Would it be a problem to add __unicode__ method like this: > > def __unicode__(self): > try: > return unicode(self.__call__()) > except pythoncom.com_error, details: > if details[0] not in ERRORS_BAD_CONTEXT: > raise > return self.__repr__() > > to class CDispatch in win32com/client/dynamic.py ? > > It would help me a lot - I need unicode data from objects. > > Or is there a way to get them ? >
Can you provide an example where the default behavior doesn't do what you expect? Usually, if a method is returning a string, it will be a Unicode string, because that's the COM standard. If a method returns a single-byte string, it's probably better to convert it yourself. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32