Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

Steve Holden steve at holdenweb.com
Fri Jan 16 21:40:11 EST 2009


Giampaolo Rodola' wrote:
> On 17 Gen, 02:24, MRAB <goo... at mrabarnett.plus.com> wrote:
> 
>> If you're truly working with strings of _characters_ then
>> 'str' is what you need, but if you're working with strings of _bytes_
>> then 'bytes' is what you need.
> 
> I work with string of characters but to convert bytes into string I
> need to specify an encoding and that's what confuses me.
> Before there was no need to deal with that.
> 
I don't yet understand why you feel you have to convert what you receive
to a string. In Python 3.0 bytes is the same as a string in 2.6, for
most practical purposes.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list