[XML-SIG] Specializing DOM exceptions
uche.ogbuji@fourthought.com
uche.ogbuji@fourthought.com
Sat, 23 Dec 2000 09:49:37 -0700
> > > To Ft/Dom/__init__.py and expected everything to break, but all
> > > was well. It seems that at least Python 2.0 is clever when the
> > > same import can be made as a package and an object. Is this also
> > > the casde with Python 1.5.2?
> >
> > I tried that with python 1.5.2 (adding a empty Node class to
> > xml/dom/__init__.py) and it looks like it's fine too.
>
> Actually, there is a problem. If you do "import xml.dom.Node", then
> you'll loose the class from __init__. Please see the attached example.
OK, not so fast, mate. Do you really think we'll let yer out so easily after
yer talked us into this?
Seriously, after a quick survey of my code, the only place I import Node is in
order to get at the constants.
I think we can deal with the problem you mentioned by re-naming
xml/dom/Node.py, perhaps to xml/dom/FtNode.py and then adjust all the internal
4DOM imports accordingly.
This should break little existing code and it would keep the nenefit of being
able to share the constants and any other material we need for normalization
across the DOM implementations.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python