[pypy-dev] Throwing arbitrary objects as exceptions (was Re: DLSpaper on RPython)

Terry Reedy tjreedy at udel.edu
Sat May 19 05:51:13 CEST 2007


"Niko Matsakis" <niko at alum.mit.edu> wrote in message 
news:FF531020-FE60-47B2-A30F-CB13D6E696F0 at alum.mit.edu...
|I guess the question is whether people consider the ability to throw
| arbitrary objects (rather than only those whose type is a subtype of
| Exception) a feature or a bug.
|
| I'm on the fence myself: it makes translating to the jvm and clr
| easier if we prohibit arbitrary objects, and it seems like a marginal
| use-case, but on the other hand, well, Python can do it, so why not?

'Python can do it'???

In 2.4, only throw (old-style) classes or instances thereof or (deprecated) 
strings.
In 2.5, I believe base exception was made new style.
In 3.0, I expect subtype thereof will be enforced.

tjr






More information about the Pypy-dev mailing list