Can raise only "classic" classes?

Alex Martelli aleax at aleax.it
Mon Jul 8 02:10:56 EDT 2002


Holden Caulfield wrote:

> Greetings,
>   I have run into a slight problem. Is it true that you can only raise
>   exceptions that are "classic" classes?

Yes, at this time.  Specifically, you should only raises [instances of] 
subclasses of the builtin class Exception, which is itself a classic class
as of 2.2 (and 2.3, at least judging from what's in CVS now).  This is
not (yet?) strictly enforced, but the fact that the class of what you
raise must be of the same object-model as Exception (which, currently,
means classic) IS.


Alex




More information about the Python-list mailing list