[Guido] > ... > While fixing the test_b1 code again, which depends on this behavior, I > thought of a refinement: it wouldn't be hard to make None compare > smaller than *anything* (including numbers). > > Is this worth it? First, an attempt to see what Python did in this morning's CVS turned up an internal error for Jeremy: >>> [None < x for x in (1, 1L, 1j, 1.0, [1], {}, (1,))] name: None, in ?, file '<stdin>', line 1 locals: {'[1]': 0, 'x': 1} globals: {} Fatal Python error: compiler did not label name as local or global abnormal program termination A simpler way to provoke that: >>> [None < 2 for x in "x"] name: None, in ?, file '<stdin>', line 1 locals: {'[1]': 0, 'x': 1} globals: {} Fatal Python error: compiler did not label name as local or global Anyway, I think forcing None to be "the smallest" is cute! Inexpensive to do, and while I don't see a compelling *use* for it, I bet it would be least surprising to newbies. +1.
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