Larry Hastings wrote:
> So now bytes are straddling the difference between strings and the other 
> mapping types:

I think the main reason it seems that way is that we're
using a string-like notation for a bytes literal. With
b[i] returning an int, it really behaves just like any
other sequence.

> So what should the bytes constructor take?  ...  Clearly it should 
 > take an int in the proper range:
 >
>     bytes(97) == b'a'

That should be

   bytes([97])

if it's to be consistent with other sequence constructors:

 >>> list(97)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: iteration over non-sequence

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | Carpe post meridiem!                 |
Christchurch, New Zealand          | (I'm not a morning person.)          |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to