
Dec. 22, 1999
6:23 p.m.
Vladimir.Marangozov@inrialpes.fr:
Yes. Besides, I still think that string-based exceptions are just convenient for quick & dirty, throw-away test scripts.
They have a hard-to-understand quirk though: the id() of the string is used to check rather than its value, so that except "foo" doesn't necessarily catch raise "foo"; but due to various optimization, this usually works, and people get bent out of shape when it doesn't. Since you have to give your exception a name, how hard is it to say class MyError(Exception): pass rathern than MyError = "MyError" ? --Guido van Rossum (home page: http://www.python.org/~guido/)