2 ms·
What's wrong with chaining try/except?
by hooloovoo_zoo 7y ago
What's wrong with chaining try/except?
- linkerzx 7y agoOne or two try/except is usually fine, but when you are nesting 3+ more try/except with the same error, the code becomes quickly unreadable. Often you would be better off having a first look at the input to figure out which case you should tackle, decompose the nested try/excepts into separate function or at the very least keep it to two nested levels.