Re: In Python 2.6, bytes is str

2008-10-07 Thread Christian Heimes
Bryan Olson wrote: Python 3 has the 'bytes' type, which the string type I've long wanted in various languages. Among other advantages, it is immutable, and therefore bytes objects can be dict keys. There's a mutable version too, called "bytearray". In Python 2.6, the name 'bytes' is defined

Re: In Python 2.6, bytes is str

2008-10-06 Thread Benjamin Kaplan
On Mon, Oct 6, 2008 at 1:30 AM, Bryan Olson <[EMAIL PROTECTED]> wrote: > > > In Python 2.6, the name 'bytes' is defined, and bound to str. The 2.6 > assignment presents some pitfalls. Be aware. > > Consider constructing a bytes object as: > >b = bytes([68, 255, 0]) > > In Python 3.x, len(b) wi

In Python 2.6, bytes is str

2008-10-05 Thread Bryan Olson
Python 3 has the 'bytes' type, which the string type I've long wanted in various languages. Among other advantages, it is immutable, and therefore bytes objects can be dict keys. There's a mutable version too, called "bytearray". In Python 2.6, the name 'bytes' is defined, and bound to str.