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
Now, to the issue at hand: CPython 3.11 implemented zero-cost exception handling (1, 2), therefore a try/except block inside a loop is no longer a perf issue, as it would be wrongfully stated by R8203: Try..except blocks have an overhead. Avoid using them inside a loop unless you're using them for control-flow. (loop-try-except-usage).
Now, I do understand that detecting the Python version being used by the script being analyzed might not be at all possible, but maybe it would be nice to clarify in the message that it does not apply to CPython 3.11+, as it would discourage writing actually performant try/except blocks.
The text was updated successfully, but these errors were encountered:
First of all, thanks for
perflint
, I love it :DNow, to the issue at hand: CPython 3.11 implemented zero-cost exception handling (1, 2), therefore a try/except block inside a loop is no longer a perf issue, as it would be wrongfully stated by
R8203: Try..except blocks have an overhead. Avoid using them inside a loop unless you're using them for control-flow. (loop-try-except-usage)
.Now, I do understand that detecting the Python version being used by the script being analyzed might not be at all possible, but maybe it would be nice to clarify in the message that it does not apply to CPython 3.11+, as it would discourage writing actually performant try/except blocks.
The text was updated successfully, but these errors were encountered: