3 ms·
But you are aware that python2 has not only bytestrings but also what you call "text"? That these are different types and there are implicit conversions between
by jstimpfle 10y ago
But you are aware that python2 has not only bytestrings but also what you call "text"? That these are different types and there are implicit conversions between them?
$ python2
>>> len('ä'), 'ä'[0]
2, \xc3
>>> len(u'ä'), u'ä'[0]
1, \xe4
>>> 'ä' == u'ä'
True
I think it's obvious that there are different levels of looking at the data that we have to deal with. If the implementors feel that the best way to enable different levels is having different representations, so be it. Note that it doesn't require twice the amount of memory if you stream the data.