Question on Strings

John Machin sjmachin at lexicon.net
Fri Feb 6 22:14:43 CET 2009


On Feb 7, 5:23 am, Terry Reedy <tjre... at udel.edu> wrote:
> John Machin wrote:
> > The UTF-n siblings are *external* representations.
> > 2.x: a_unicode_object.decode('UTF-16') -> an_str_object
> > 3.x: an_str_object.decode('UTF-16') -> a_bytes_object
>
> That should be .encode() to bytes, which is the coded form.
> .decode is bytes => str/unicode

True. I guess that makes me the Dohmouse :-)



More information about the Python-list mailing list