Hallöchen! Stefan Behnel writes:
> Torsten Bronger wrote: > >> [...] >> >> My problem is that if there is only ASCII, these methods return >> ordinary strings instead of unicode. So sometimes I get str, >> sometimes I get unicode. Can one change this globally so that >> they only return unicode? > > That's a convenience measure to reduce memory and processing > overhead. But is this really worth the inconsistency of having partly str and partly unicode, given that the common origin is unicode XML data? > Could you explain why this is a problem for you? I feed ElementTree's output to functions in the unicodedata module. And they want unicode input. While it's not a big deal to write e.g. unicodedata.category(unicode(my_character)), I find this rather wasteful. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: torsten.bron...@jabber.rwth-aachen.de -- http://mail.python.org/mailman/listinfo/python-list