returning True, False or None

Fredrik Lundh fredrik at pythonware.com
Fri Feb 4 14:59:01 EST 2005


Steven Bethard wrote:

>> return max(lst)
>
> Very clever!  Thanks!

too clever.  boolean > None isn't guaranteed by the language specification:

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

    "... objects of different types always compare unequal, and are ordered consistently
    but arbitrarily. /.../ In the future, the comparison rules for objects of different types are
    likely to change. ..."

</F> 






More information about the Python-list mailing list