A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132409.html below:

[Python-Dev] python 3 niggle: None < 1 raises TypeError

[Python-Dev] python 3 niggle: None < 1 raises TypeErrorSerhiy Storchaka storchaka at gmail.com
Mon Feb 17 12:47:19 CET 2014
17.02.14 13:14, M.-A. Lemburg написав(ла):
> Here's a particularly nasty case:
>
>>>> l = [(1, None), (2, None)]
>>>> l.sort()
>>>> l
> [(1, None), (2, None)]
>
>>>> l = [(1, None), (2, None), (3, 4)]
>>>> l.sort()
>>>> l
> [(1, None), (2, None), (3, 4)]
>
>>>> l = [(1, None), (2, None), (3, 4), (2, 3)]
>>>> l.sort()
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> TypeError: unorderable types: int() < NoneType()

If you replace None to another value that cannot be compared with int 
(e.g. string), you will got the same nasty case.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4