try: except <never>:
Hallvard B Furuseth
h.b.furuseth at usit.uio.no
Fri Jan 13 10:11:16 EST 2006
Thanks for the help.
Tom Anderson writes:
>> class NeverRaised(Exception):
>> def __init__(self, *args):
>> raise RuntimeError('NeverRaised should never be raised')
>
> Briliant! Although i'd be tempted to define an UnraisableExceptionError
> to signal what's happened. Or ...
A package we are using has ProgrammingError (like AssertionError except
__debug__ doesn't disable it), and RealityError when something *really*
can't happen:-)
--
Hallvard
More information about the Python-list
mailing list