HowCanI: inlined exceptions

ben at ben at
Sat May 27 14:03:36 CEST 2000

def foo(str):
    return str

def baz(str):
    raise str

def bar(str1,str2):
    return str1 + str2

def catch(function, list_of_argcs, error=None):
        return apply(function, list_of_argcs)
        return error

a = catch(foo, ("blabla",), "Failed")
print a
b = catch(baz, ("blabla",))
print b
c = catch(bar, ("blabla", "flafla"))
print c

ben . de . rydt at pandora . be ------------------ your comments ------- inl. IPv6, Linux en Pandora

More information about the Python-list mailing list