On Tue, Apr 12, 2011 at 11:44 AM, Grant Edwards <invalid@invalid.invalid> wrote:
> How is that the same?
>
>  return? something()                  return something() or None
>  return? somethingelse()              return somethingelse() or None
>  log("didn't find an answer")         log("didn't find an answer")
>  raise ValueError                     raise ValueError
>
> Are you saying the two snippets above are equivalent?

def foo(n):
    x = n < 5
    if x:
        return x

is functionally equivalent to:

def foo(n):
    return n < 5

-- 
-- James Mills
--
-- "Problems are solved by method"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to