try: except <never>:

Paul Rubin http
Tue Jan 10 08:43:05 EST 2006


Hallvard B Furuseth <h.b.furuseth at usit.uio.no> writes:
> > class NeverRaised(Exception): pass
> > for ex in ZeroDivisionError, NeverRaised:
> 
> Heh.  Simple enough.  Unless some obstinate person raises it anyway...

Hmm, ok, how's this?:

   def NeverRaised():
     class blorp(Exception): pass
     return blorp
   for ex in ZeroDivisionError, NeverRaised():
     ...



More information about the Python-list mailing list