Raising objects
Greg Ewing (using news.cis.dfn.de)
ckea25d02 at sneakemail.com
Wed Apr 30 23:32:11 EDT 2003
Andrew Dalke wrote:
> However, if all exceptions were derived from Exception
> then you could do
>
> except Exception, e:
> ... use e ...
>
> This cleans up the wart at the expense of not allowing
> any old object to be thrown.
Another related wart could be cleaned up at the same
time: if the traceback were available as an attribute
of the exception, it would eliminate the need for
sys.exc_info altogether.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list