Question about 'None'

Fredrik Lundh fredrik at pythonware.com
Thu Jan 27 14:10:00 EST 2005


"flamesrock" <flamesrock at gmail.com> wrote:

> The statement (1 > None) is false (or any other value above 0). Why is
> this?

http://docs.python.org/ref/comparisons.html

    "The operators <, >, ==, >=, <=, and != compare the values of
    two objects. The objects need not have the same type. If both
    are numbers, they are converted to a common type. Otherwise,
    objects of different types always compare unequal, and are
    ordered consistently but arbitrarily.

    (This unusual definition of comparison was used to simplify the
    definition of operations like sorting and the in and not in
    operators. In the future, the comparison rules for objects of
    different types are likely to change.)"

</F> 






More information about the Python-list mailing list