From: Sheila King Subject: Re: subclassing Exceptions Newsgroups: comp.lang.python Date: Sun, 22 Jul 2001 04:44:44 GMT Path: news1.rdc1.md.home.com!newsr1.rdc2.pa.home.com!newshub1.rdc2.pa.home.com!a-newshub1.rdc2.pa.home.com!newshub2.home.com!news.home.com!newsfeed.direct.ca!look.ca!paloalto-snh1.gtei.net!news.gtei.net!paloalto-snr1.gtei.net.POSTED!not-for-mail Message-ID: References: <9ihklt8u0vvh1aa0mg6tadbmjo9mot47e0@4ax.com> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 49 X-Trace: +rTuhsKMNSBHpTtj6l4+uafrTFCGRWj8ldqVsEylXMRL4loAb9R9e8b+i3y3bCPV8jWf2jXP1hGI!ux/j7apX8c3V7SH1diUO6AHYTDwsFE66mh0rMQ2DqKE26+UmTnU18tARwsd7mxDe+VO+3GaNf8sA!tFY= X-Complaints-To: abuse@gte.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Sun, 22 Jul 2001 04:44:44 GMT Distribution: world Xref: newshub1.rdc2.pa.home.com comp.lang.python:30123780 On Sat, 21 Jul 2001 20:49:01 -0700, "Brian Quinlan" wrote in comp.lang.python in article : :> I tried looking under the /Python20 directory for source or something :> for the Exception classes, but can't find it. For example, right now :> I'm working on subclassing the rfc822.py module, and I found the file :> rfc822.py in /Python20/Lib and studied the source until I understood :> it, and could subclass it. I'd like to find something similar for the :> standard exception classes. I looked in the /include directory and :> some others but can't find what I'm needing. : :Check out http://www.python.org/doc/current/lib/module-exceptions.html : Thanks, Brian, but I've seen the docs many times. I need more info than that. Like example code, or source code. However, someone else gave me some pointers. If I want to see the actual source for the exceptions.c class, I can browse at sourceforge.net here: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/ I found the exceptions.c file here: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Python/exceptions.c However, I may not need that much detail and background. Maybe a few examples of subclassing exceptions in Python would do. So, one might want to look at these: See the source for this module: http://python.org/doc/current/lib/module-xml.sax.html (although, later thought to possibly be a bit complicated) or How about viewing the source for the ConfigParser.py module. Anyhow, I've looked a bit over the exceptions.c file, which is interesting. Now I'm off to study the source for the (above) suggested Python modules, as examples of subclassing exceptions. -- Sheila King http://www.thinkspot.net/sheila/ http://www.k12groups.org/