From: "Fred L. Drake, Jr." firstname.lastname@example.org
Guido van Rossum writes:
(The next step would be to outlaw raise with a string argument; I think I can't make that for 1.6. But it would be a good idea to scan the standard library for string exceptions and convert all of them.)
I don't know if requiring class-based exceptions will make the runtime any simpler, but that seems the only reason to do it.
Do what? *Require* class exceptions? You're probably right, and I think the gain is minimal.
There's another reason to scan the std library though -- not to set a bad example. I want to eventually (in 2.0) move to a class-derived-from-Exception-only scheme.
The only reason to remove -X, and possibly the string exception fallback code, is to ensure that we *can* subclass Exception and friends without having to catch TypeError and do something different.
And that's a very good reason indeed.
Let me repeat my plans for 1.6.
- Remove -X; the standard exceptions are always class-based.
- Change all standard library and other example code to use class-based exceptions with a standard exception as base class, to set an example.
- Still allow string exceptions in user code.
- Still allow class exceptions that don't use a standard exception base class in user code.
--Guido van Rossum (home page: http://www.python.org/%7Eguido/)