"More About Unicode in Python 2 and 3"

Ethan Furman ethan at stoneleaf.us
Mon Jan 6 11:23:15 EST 2014


On 01/06/2014 07:46 AM, Chris Angelico wrote:
>
> None of this changes the fact that there are bytes used to
> store/transmit stuff, and abstract concepts used to manipulate them.
> Just like nobody expects to be able to write a dict to a file without
> some form of encoding (pickle, JSON, whatever), you shouldn't expect
> to write a character string without first turning it into bytes.

Writing is only half the battle, and not, as it happens, where I experience the pain.  This data must also be /read/. 
It has been stated many times that the Py2 str became the Py3 bytes, and yet never in Py2 did 'abc'[1] return 98.

--
~Ethan~



More information about the Python-list mailing list