You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where it should not be caught is, in my opinion constructs like the one displayed above. The problem is that this error can't be acted on for such an example. You can't move the try/except outside the loop since that would make an exception skip everything that follows the try/except.
As for where it should be caught, I think it's tricky because there's a balance. While it is more efficient to have try/except around the loop, it means that more code is protected by the try/except, which is a downside. Ideally, you want the minimum amount of code in a try/except.
I'm not sure what others like, but personally I don't find this error useful in the first place since it is trying to add more code to the try/except.
I think that PERF203 should only trigger when the exception handler unconditionally raises.
Although, this is not a priority for me since I decided to disable it. It never caught anything useful for me.
The text was updated successfully, but these errors were encountered: