- dm.LeafNode has (length, element), where length is ignored and forced to 0 by all subclasses except for dm.TextNode
- dm.BranchNode has (children, element), length is computed while children are added
The code in dm.Document constructing node trees needs to be aware of this, but at the same time it doesn't even use these parameters, because branch nodes are created as childless nodes that have their children added later, and text nodes are created with length zero and have the correct length set later. So we should just get rid of these parameters and make the constructors take a single element parameter, that would get them in line with other dm.Model subclasses (dm.Annotation and dm.MetaItem) as well.
While we're at it, we should also fix the documentation that claims that the element parameter is optional, it really isn't.
Version: unspecified
Severity: enhancement