3 ms·
What about using "finally," which if IIRC is already a thing in Python and encapsulates this idea pretty neatly?
by avn2109 12y ago
What about using "finally," which if IIRC is already a thing in Python and encapsulates this idea pretty neatly?
- dbarlett 12y agofinally blocks are always executed; this kind of else block is only executed if the for block exited normally (i.e. did not throw an exception).