M.-A. Lemburg <mal <at> egenix.com> writes: > > Why was the special case for None being "smaller" than all other > objects in Python removed from Python 3.0 ? (see object.c in Py2.x)
Because ordered comparisons (<, <=, >, >=) are much stricter in 3.0 than in 2.x. In practice, ordered comparisons which don't have an obvious, intuitive meaning now raise a TypeError (such as comparing a number and a string). > It looks like a bug in Python 3.0 to me, since None is widely used as > "n/a" object in Python. But why should "n/a" (or "missing", or "undefined") imply "smaller than everything else"? I understand it might be a case of "practicality beats purity", but this is not semantically obvious and can also let bugs slip through (the very bugs that the stricter ordered comparison semantics in 3.0 are meant to make easier to detect). Also there are cases where you'll want something which is *bigger* than everything else, not smaller. (SQL seems to do such a thing with NULL, but SQL isn't exactly a good example for programming language design, is it?) If it is really useful, I think i would be cleaner and more explicit to add the Smallest and Largest constants suggested elsewhere, than reuse a very widely used constant (None) for half of the purpose. cheers Antoine. _______________________________________________ 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