This is a noob question, but here goes. I have a class that calls a
function.
class test:
def __init__(self):
if foo():
print "it worked"
else:
print "error"
def foo():
some test returns 1 or 0
Now in other langs like C / C++ I catch the error in foo and report and
exit.
However I suspect in python that I can raise it and the class can catch
it ?
This is a noob question, but here goes. I have a class that calls a function.
However I suspect in python that I can raise it and the class can catch it ?
the "errors and exceptions" chapter in the tutorial might be helpful: