Abuse of the object-nature of functions?

Ant antroy at gmail.com
Tue Jul 11 15:11:26 EDT 2006


> Is there a way in python to say, "hey, catch everything but these two"?

>>> try:
...   raise AttributeError
... except Exception, ex:
...   if isinstance(ex, AttributeError):
...     print "Won't catch it!"
...     raise ex
...

Won't catch it!
Traceback (most recent call last):
  File "<stdin>", line 7, in ?
AttributeError

Or that sort of thing.




More information about the Python-list mailing list