[XML-SIG] Ugh! Why are DOM access methods spelled with a leading '_'?

Mike Olson Mike.Olson@fourthought.com
Fri, 23 Jun 2000 12:52:51 -0600

Jim Fulton wrote:
> Traditionally, Python attributes (including methods) with
> names starting with '_' were treated as private.
> Why oh why then does the Python DOM implementation use
> method names beginning with '_'s in the public API (for
> getting attributes), as in '_get_nodeType'? Why not
> 'get_nodeType' or 'getNodeType'? Is the intent that these
> functions shouldn't be called by Python code?

The methods really are not part of the DOM API. 

Example: the API defines the attribute nodeType.  the python mapping
(based off the python CORBA mapping) translates this into _get_nodeType
for accessors.

This interface is not published, but people do use it.  It is encouraged
that you directly
access the attributes.

> Is there are description somewhere of the Python DOM mapping,
> other than the DOM sources?

I'm not sure if anyone has put together a formal document.  We've based
most of it off the CORBA mapping at


> 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.
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig

Mike Olson				 Principal Consultant
mike.olson@fourthought.com               (303)583-9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
Software-engineering, knowledge-management, XML, CORBA, Linux, Python