4 ms·
Python 3.11 made the "try" part of exceptions zero-cost. The "except" part only has overhead if the exception is triggered.
by stevesimmons 4y ago
Python 3.11 made the "try" part of exceptions zero-cost. The "except" part only has overhead if the exception is triggered.
- diarrhea 4y agoSo the answer to the question is yes, because for loops signal their finishing by raising an exception.