Another advantage is that you can catch all the unhandled exceptions of
the entire program (it they occurs) by doing something like this:

def another_call():
    raise SomeUnexpectedException   # it will be catched in '__main__'

def call():
    another_call()

def run():
    call()

in __name__ == '__main__':
    try:
         run()
    except:
         # do cleanup
         # log exit message
         # exit

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to