[pypy-dev] Re: deep breakage

Armin Rigo arigo at tunes.org
Thu Jun 12 14:42:01 CEST 2003


Hello Guido,

I'm just wondering: as we are heading towards Exception being a new-style 
class (no old-style classes being supported currently) I can see a very 
theoretical problem which must already have been discussed in python-dev (has 
it?):

   raise x

should be "raise x()" if issubclass(x, Exception) and "raise x" if 
isinstance(x, Exception). What if:

>>> class exception(object): pass
... 
>>> class f(type, exception): pass
... 
>>> x = f('x', (exception,), {})
>>> isinstance(x, exception)
1
>>> issubclass(x, exception)
1

Ok that's kind of a joke :-)

Armin


More information about the Pypy-dev mailing list