[XML-SIG] Ugh! Why are DOM access methods spelled with a leading
'_'?
Jim Fulton
jim@digicool.com
Tue, 27 Jun 2000 11:03:07 -0400
Paul Prescod wrote:
>
> Jim Fulton wrote:
> >
> > ...
> >
> > Yup, however __getattr__ is a pain to utilize unless you have alot of
> > infrustructure. Zope has support for computed attributes, which makes
> > this pretty sane, especially for read-only attributes.
>
> a) I think all that you need is a base class. Minidom uses one and it
> seems to work. Anyhow, inherting from "node" is good practice in any DOM
> extension framework.
This is fine if your classes *only* want to implement DOM or
other related APIs. I'd like to be able to add support for the
DOM API to objects *without* making objects DOM specific. For
example, I'd like to provide DOM support in most, if not all Zope
objects. These objects altready implement __getattr__ for other
purposes.
Jim
--
Jim Fulton mailto:jim@digicool.com Python Powered!
Technical Director (888) 344-4332 http://www.python.org
Digital Creations http://www.digicool.com http://www.zope.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.