3 ms·
I should add that even Python's standard lib has functions that throw exceptions. This behavior is not immediately visible in the function type signature (`-> s
by behnamoh 2y ago
I should add that even Python's standard lib has functions that throw exceptions. This behavior is not immediately visible in the function type signature (`-> str` doesn't tell us that the function could return string or throw). So essentially the programmer needs to read the function body and look for exceptions.
Also, when handling each type of exception, that often means we need to import those specific exceptions. Importing tens of exceptions at the top of the file is just not an elegant approach imo. Also, we can never be sure that we've found all types of exceptions.