jeudi 28 juillet 2016

How to make string interpreted as bytes?

Python 2 str compatable with bytes, but on Python 3 str is unicode.

I working on porting some project to Python3, but with support Python2.7. This prodject has tests with many string constants. Also there is few '...'.join(...) and '...'.format(...).

How to make Python3 to b'123' == '123' ?

Aucun commentaire:

Enregistrer un commentaire