[XML-SIG] Specializing DOM exceptions

Fred L. Drake, Jr. fdrake@acm.org
Sat, 25 Nov 2000 14:23:03 -0500 (EST)


Martin v. Loewis writes:
 > I'd like to propose an enhancement to the DOM exception classes,
 > namely that different codes are mapped to different subclasses:
...
 > That will simplify raising the exceptions, and catching a specific one
 > if desired. It will still provide the backwards-compatibility of
 > accessing .code of the exception (which should *not* be removed, even
 > after a while, IMO).

  I like this idea; very Pythonic!  The exceptions and .code values
could live in xml/dom/__init__.py (or at least be imported there so
the values are used from xml.dom, instead of from individual DOM
implementations.
  I'd also like to see the .nodeType values defined this way, and
  shared by the implementations.

 > I'd like to re-arrange the internationalization in this code:
 > It shouldn't take a %i parameter, since the traceback will read
...

  I don't know about the i18n issues; I'll bow to your superior
expertise in this area.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations