Sometimes you don't want to place any code in the except part because you just want to be assured of a code running without any error but not interested to catch them. I could do this like so in C#:
try { do_something() }catch (...) {} How could I do this in Python ?, because the indentation doesn't allow this:
try: do_something() except: i_must_enter_somecode_here() BTW, maybe what I'm doing in C# is not in accordance with error handling principles too. I appreciate it if you have thoughts about that.
passin theexceptblock is totally fine in Python. Using bare excepts (without specifying an exception type) however is not. Don't do it, unless it's for debugging or if you actually handle those exceptions in some way (logging, filtering and re-raising some of them, ...).exceptblock is not a good thing. Don't learn it. Just think about what kind of log code you can include in there. In the long run that habit would save you much more time.