How do I know all thrown exceptions of a function?

Randall Hopper aa8vb at yahoo.com
Mon Jan 22 13:47:26 EST 2001


Fredrik Lundh:
 |Sean Reifschneider wrote:
 |> Yeah, I suppose so.  I don't think you should *HAVE* to review the code of
 |> the libraries you call, AND *EVERYTHING* that *THEY* call.  It's not an
 |> effective use of my time...
 |
 |yeah, and what's worse, having to *TEST* your code before
 |shipping just sucks...

Like Steve, I think this is a bit too harsh.  What exceptions a public API
can throw is part of its interface, just like parameters and return values.

In Python's present form which is light on strict definitions, this is
arguably not a big issue.  But in the future when typing is added to
interfaces, exceptions need to be included in that signature.  

Groveling through library code for rare exception conditions (initially,
and for each dependency version update) isn't a productive use of a
developer's time.

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list