8.3.2.2.4.2. __bool__

dsp.__bool__()

Node instances are always true, even if they’re empty. A node is more than a simple container. Its boolean “truth” does not depend on having one or more subnodes in the doctree.

Use len() to check node length.