[Python-Dev] [Fwd: In Python 2.6, bytes is str]

Nick Coghlan ncoghlan at gmail.com
Mon Oct 6 13:17:34 CEST 2008


Brett Cannon wrote:
> What I would like to know if there are any other gotchas beyond the
> constructor as all of the other uses act as you would expect.

Mainly that indexing returns one character substrings instead of ints.

The bytes type is there as an indicator of what bytes literals represent
in 2.6 - yes, that's not the same thing as what they represent in 3.0,
and no, you don't magically get the benefits of byte/str separation in
the 2.x series.

Maybe that could be caveat'ed better somewhere in the docs, but it does
reflect the reality of the situation.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org


More information about the Python-Dev mailing list