How do I know all thrown exceptions of a function?

Alex Martelli aleaxit at yahoo.com
Tue Jan 23 06:54:51 EST 2001


"Delaney, Timothy" <tdelaney at avaya.com> wrote in message
news:mailman.980206945.31338.python-list at python.org...
> > I think this covers all worries with backwards compatibility,
> > whilst moving towards a well-defined exception system.
>
> Sorry - all worries with backwards compatibility *except* the basic one
that
> functions would now need to declare the exceptions they raise. I don't
know
> how to get around that one.

What about the C++ approach: a function not declaring what
exceptions it raises is deemed to be a "legacy" function,
potentially able to raise ANY exception whatsoever (functions
that need to express "I'll never raise any exception" have
to do that explicitly).


Alex






More information about the Python-list mailing list