[ python-Bugs-1495229 ] W3C <-> Python DOM type mapping docs need updating

SourceForge.net noreply at sourceforge.net
Sun Jul 30 06:56:06 CEST 2006


Bugs item #1495229, was opened at 2006-05-25 19:33
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495229&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Brown (mike_j_brown)
Assigned to: Martin v. Löwis (loewis)
Summary: W3C <-> Python DOM type mapping docs need updating

Initial Comment:
I believe the information at
http://docs.python.org/lib/dom-type-mapping.html is
outdated; most if not all boolean return values, at
least in minidom, are handled as BooleanType, not
IntegerType. This should be standard.

Sorry, I don't have a patch to submit for this. Should
be an easy fix though.

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2006-07-30 00:56

Message:
Logged In: YES 
user_id=3066

My position on this is that:

1) The docs are not wrong.

2) The docs should be updated to indicate that bool values
are returned where appropriate.

3) It is reasonable that Python developers know the
relationship between bool and int.  That is not something
that can reasonably change in Python 2.x.  It seems unlikely
to change for Python 3000.

4) The strict application of the IDL mapping really hasn't
helped in creating a good DOM-like interface for Python.

Dealing with the last item isn't within scope for handling
this issue.


----------------------------------------------------------------------

Comment By: Mike Brown (mike_j_brown)
Date: 2006-06-03 17:01

Message:
Logged In: YES 
user_id=371366

If answer #1 is chosen and the others rejected, then the
docs remain misleading, since the average reader just wants
to know what types to expect from an implementation (or
should code into their implementation), and shouldn't be
expected to know the relationship between Booleans and
integers. Is it even reasonable to expect that this
relationship will always be true? In any case, I'd rather
see it made explicit as to why minidom doesn't seem, at
first, to respect the type mapping, at least in current
implementations. It could be as simple as adding Andrew's
comment, phrased as "This DOM mapping is derived from the
IDL mapping for Python, which predates the introduction of
BooleanType, which is currently a subtype of IntegerType.
Implementations may use either type." or some such.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2006-06-03 16:42

Message:
Logged In: YES 
user_id=11375

Martin, you probably need to make a pronouncement on this.  The DOM 
mapping is supposed to be derived from the IDL mapping for Python, which 
predates Booleans, but methods such as hasChildNodes() return True/False.
I can see at least three answers:

1) Booleans are subtypes of integers, so the docs are not wrong.

2) The docs are wrong and should say Boolean.

3) The methods should be returning regular 0 and 1, not True and False, and 
should be changed.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495229&group_id=5470


More information about the Python-bugs-list mailing list