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

Jim Fulton jim@digicool.com
Tue, 27 Jun 2000 18:08:29 -0400

Uche Ogbuji wrote:
> > I'll be willing to give on this, however, I assert that
> > a decision isn't a decision unless it's published.
> >
> > It doesn't help when the people who made the decision
> > can't seem to remember what it was.

This was too strongly worded

> _Completely_ untrue. 

That's strong, and I can't agree with this characterization.

> Can you point me to a post where someone said they don't
> kow what the decision was? 

There were a number of posts that made it seem that 
there wasn't a consensus.  For example, 


    Mike says "The methods really are not part of the DOM API".

    That is, just use the attributes.


     Fred says "The W3C documentation gives the IDL mapping, 
     which requires the Python specific mapping.".

     Fred reinforces this in 

     Now since the Python CORBA mapping doesn't provide for
     direct attribute access, a reasonable person would expect that
     Python DOM uses accessor methods (with leading '_'s).

     Dieter says "DOM is specified in terms of IDL.
     Python has an IDL -> Python mapping.
     Deviating from this mapping for DOM only would require special
     knowledge -- a thing I do not like."

     Hm, based on the Python IDL mapping, we use accessor methods
I could go on, but I won't.

If there was a published mapping, we wouldn't be covering this
ground again.

> I _can_ point you to posts where the consensus was
> summarized.  See, for instance
> http://www.python.org/pipermail/xml-sig/1999-November/003281.html  (and
> following posts)
> http://www.python.org/pipermail/xml-sig/1999-November/003313.html
> The whole affair started in the "4DOM future" thread and continued in the
> "foo.bar vs. foo.get_bar()", rounding out in the "CORBA compliance for the DOM
> in Python?" thread and other sundry conversations.

Thanks. How would anyone know about this without living in the SIG or
searching the archives? Obviously they wouldn't.

Even after reading these, I don't see a very strong
consensus. The strongest indication of consensus is in the
second link you provided, which points to an 
"unofficial Python binding".

> > Supposedly, the
> > decision was that DOM attributes are accessed as ordinary
> > Python attributes, as in::
> >
> >   foo.nodeName
> Yes.
> > yet several people seemed to think that attributes are obtained
> > via accessor functions:
> >
> >   foo._get_nodeName()
> Yes.  The decision was "both".  See the links.

OK, I'll try to summarize this in a sperate message.


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