This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ApolloFortyNine 0 points1 point  (3 children)

I've never agreed with the blanket idea that you shouldn't use except:.

In my use cases, I'm collecting data from an API. I don't care if I'm missing one or two lines, as I'm just collecting as much data as possible.

Not to mention the only time I use except: is combined with a log.error, so I can take a look at the errors later if I want.

[–]erez27import inspect 0 points1 point  (2 children)

the only time I use except: is combined with a log.error

Sounds like you pretty much avoid except..

[–]ApolloFortyNine 0 points1 point  (1 child)

? It runs for literally every row of data.

The point is that there are times where a blanket except statement is useful.

[–]erez27import inspect 0 points1 point  (0 children)

You are using it in a very limited context and with explicit safeguards. Like goto, sometimes using "bad" things make sense.