"monty" < "python"

Ian Foote ian at feete.org
Wed Mar 20 15:17:13 CET 2013


On 20/03/13 13:38, Jan Oelze wrote:

> "Strings are compared lexicographically using the numeric equivalents
> (the result of the built-in function ord()) of their characters. Unicode
> and 8-bit strings are fully interoperable in this behavior."

This isn't true in python 3:

Python 3.2.3 (default, Oct 19 2012, 19:53:57)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> b'bytes' < 'unicode'
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: unorderable types: bytes() < str()

Ian F



More information about the Python-list mailing list