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

Martijn Faassen faassen@vet.uu.nl
Mon, 10 Jul 2000 16:58:56 +0200


Dieter Maurer wrote:
> Jim Fulton writes:
>  > We seem to be arguing two issues:
>  > 
>  >   - Whether to expose DOM attributes as Python attributes or
>  >     accessor functions, and
>  > 
>  >   - How to spell the accessor functions.
>  > 
>  > If we go with accessor functions, which I think would be 
>  > a good idea, then the accessor functions should be
>  > names in a way that is consistent with Python practice.
> 
> Python, unlike Zope, does *not* treat *methods/attributes*
> with leading '_' specially.
> Only objects in modules with names starting with a '_'
> are in some way treated as private.

While the Python implementation doesn't treat _ methods and attributes
specially, the Python lore definitely does. At least, I use _ in 
Python code to indicate 'treat this as private'. I certainly was
puzzled by the _get_ and _set_ in the DOM when I first saw it (I hadn't
heard the IDL explanation).

Regards,

Martijn