[Python-porting] repr() with same output on Python2.7 and Python3.x

Thomas Güttler guettliml at thomas-guettler.de
Mon Sep 11 09:12:56 EDT 2017


Hi,	

I have a Python 2.7 code base before me, where some tests contain the output of repr().

On Python2.7 I see u'foo' and on Python3 I see 'foo'.

This is the reason why some tests fail.

Is there a repr() which outputs the same string on Python2.7 and Python3?

It would be nice if I could get the Python3 output on Python2.7

Regards,
   Thomas Güttler

-- 
Thomas Guettler http://www.thomas-guettler.de/


More information about the Python-porting mailing list