On 8/18/07, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Victor Stinner wrote:
> > Hi,
> >
> > I don't like the behaviour of Python 3000 when we compare a bytes strings
> > with length=1:
> >    >>> b'xyz'[0] == b'x'
> >    False
> >
> > The code can be see as:
> >    >>> ord(b'x') == b'x'
> >    False
>
> This seems to suggest its own solution:
>
>    bytes_obj[0] == ord('x')
>
> (Given that ord converts *characters* to bytes, does it actually make
> sense to allow a bytes object as an argument to ord()?)

No, I added that as a quick hack during the transition. If someone has
the time, please kill this behavior and fix the (hopefully) few places
that were relying on it.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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