"""This is a convenient way to deeply nest try/finally statements.""" __docformat__ = "restructuredtext" # Created: Tue Oct 11 08:42:23 PDT 2005 # Author: Shannon -jj Behrens # Email: jjinux@users.sourceforge.net # # Copyright (c) Shannon -jj Behrens. All rights reserved. from traceback import print_exc def tryFinally(tasks, handleFinallyException=None): """This is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function is appropriate. Given:: tasks = [ ((f_enter_0, enter_0_args, enter_0_kargs), (f_exit_0, exit_0_args, exit_0_kargs)), ((f_enter_1, enter_1_args, enter_1_kargs), (f_exi
This is a purely technical blog concerning topics such as Python, Ruby, Scala, Go, JavaScript, Linux, open source software, the Web, and lesser-known programming languages.
Ad maiorem Dei gloriam inque hominum salutem.