[Tutor] subclassing Exceptions

Sheila King sheila@thinkspot.net
Sun, 22 Jul 2001 11:47:47 -0700


On Sun, 22 Jul 2001 07:10:45 -0400 (EDT), "Michael P. Reilly"
<arcege@dsl092-074-184.bos1.dsl.speakeasy.net>  wrote about Re: [Tutor]
subclassing Exceptions:

:Then you might want to download Python 1.5.2 (binaries or sources).
:The exceptions were Python classes, not C classes (or a built-in module
:for that matter).  The C code in the exceptions.c file aren't really going
:to help you subclass the exceptions in Python.  It will help you if you
:ever decide to create C extension classes instead of C extension types.
:(There is no direct mechanism in the C API to create a Python class,
:only Python types (string, integer, list, etc.).)

Thanks for the tip.

:For the most part, you usually do not have to override the methods unless
:you want to handle the data in a very specific manner.  The Exception
:class already handles data in versatile ways.  The subclasses you had
:before usually suffice.

Yes, I'm beginning to get a feel for it now.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/