3 ms·
In general, I agree. But "Only throw exceptions for the exceptional"? The rationale for this guideline sounds like a performance-driven one ("since throwing ex
by lincolnq 17y ago
In general, I agree. But "Only throw exceptions for the exceptional"?
The rationale for this guideline sounds like a performance-driven one ("since throwing exceptions will add unnecessary overhead"). This isn't always true, and contradicts a well-known Pythonic idiom (return victorious or not at all), which is a good idiom because it makes the client code easier to write and maintain (no testing return values; problems are handled out-of-band).