Except an exception AND all its subclasses?
Moshe Zadka
moshez at math.huji.ac.il
Fri Feb 11 17:02:23 EST 2000
On Fri, 11 Feb 2000, Gerrit Holl wrote:
> Hello,
>
> it's not possible to catch an exception and all its subclasses as
> of python 1.5.2, is it?
>
> I think this would be a nice feature for a future version of Python.
> What do you think?
Why, yes, Gerrit.
-- Hey Barry! Stop trying to be your own father and let me use the time
machine for a second.
class A:
pass
class B(A):
pass
try:
raise B
except A:
print "caught it"
Ouch! Barry, why didn't you want me about that step?
--
Moshe Zadka <mzadka at geocities.com>.
INTERNET: Learn what you know.
Share what you don't.
More information about the Python-list
mailing list