Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 5
    I think a decorator would fit here. Commented Jun 26, 2013 at 14:05
  • If b fails (raises an exception), c will not be executed, nor will d. Commented Jun 26, 2013 at 14:05
  • it is Commented it is just there as a comment.... could write pass too..... edited it, better? Commented Jun 26, 2013 at 14:06
  • 1
    Okay that's what I thought, for each code I have to create a new try block. Because let's say I have several codes to be run, it should continue even if an exception occurs. Because what it does now, when the first exception occurs, when B fails, it will skip the other codes.Which is not what I want. Even if B fails it should try C, if C fails it should try D. No matter if error or not it should run through all lines. Hope it's better to understand now. Commented Jun 26, 2013 at 14:39
  • 1
    except: pass ... else: return True is an obscure way of implicitly saying except: return None ... else: return True. Better to be explicit. Commented Dec 14, 2017 at 20:59