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()?)

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
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