[issue5425] 2to3 wrong for types.StringTypes

Hagen Fürstenau report at bugs.python.org
Fri Mar 6 07:59:51 CET 2009

Hagen Fürstenau <hfuerstenau at gmx.net> added the comment:

Why I considered the existing translation incorrect was because it
translates something which was a tuple of types in Python 2.x into a
type of Python 3.x. I fail to see how this can be useful. (A check like
"x in types.StringTypes" gets translated into "x in str", which will
always fail.)

I agree that translating into "(str, bytes)" won't always be correct,
but it seems to have a much better chance of being correct than the
existing translation into "str". Otherwise it should at least be "(str,)".

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list