Syntax across languages

Fredrik Lundh fredrik at pythonware.com
Sun Oct 23 05:54:55 EDT 2005


bearophileHUGS at lycos.com wrote:

> >sure looks like four possible outcomes.<
>
> Right (but to me four explicit answers seem better than three answers
> and an exception still).

def cmp4(a, b):
    try:
        return cmp(a, b)
    except:
        return None

</F>






More information about the Python-list mailing list