Martin v. Löwis wrote: >> entity_map = htmlentitydefs.entitydefs.copy() >> for name, entity in entity_map.items(): >> if len(entity) != 1: >> entity_map[name] = unichr(int(entity[2:-1])) >> >> (entitydefs is pretty unusable as it is, but it was added to Python >> before Python got Unicode strings, and changing it would break ancient >> code...) > > I would not write it this way, but as > > for name,codepoint in htmlentitydefs.name2codepoint: > entity_map[name] = unichr(codepoint)
has dictionary iteration changed in 3.0? if not, your code doesn't quite work. and even if you fix that, it doesn't work for all Python versions that ET works for... </F> -- http://mail.python.org/mailman/listinfo/python-list