Fred L. Drake Fred.L..Drake at
Tue Jun 29 14:02:26 EDT 1999

From: "Fred L. Drake" <fdrake at>

Tim Peters writes:
 > Honestly, I had never seen a RuntimeError before!  I found this one by

  Ooh, lucky you!  ;-)  Actually, I've seen very few.

 > digging thru the source code to see when it gets raised.  There's really no
 > pattern to it, and the RuntimeError docstring in Lib/

  When RuntimeError is raised by the interpreter itself, that seems to 
be the case.  When documenting modules, I've seen that a lot of them
do things like "raise RuntimeError" (note: no parameters) whenever
they need to raise an exception and the programmer hadn't already
defined an exception specific to the module.  I consider this a real
problem, since it becomes hard to catch just the right exception.  The 
ones I've seen in modules didn't seem to be so serious, just lazy
about defining new exceptions the might only get used in one place.
  I've not maintained a list of where I've see this, unfortunately:
fixing them would be a worthwhile activity.


Fred L. Drake, Jr.	     <fdrake at>
Corporation for National Research Initiatives

More information about the Python-list mailing list