I'm using reStructuredText as an input format for RinohType . Since I want to provide useful warning/error messages, I rely on the source, tagname and line attributes of the Node instances to point the user to the relevant location in the source file.
I have noticed that not all Node instances have non-None source and/or line attributes. For example, the following nodes (among others) in the quickstart.txt  have missing data:
* literal_block at line 119: document is None
* enumerated_list at line 143: both document and line are None
* bullet_list at line 179: both document and line are None
* literal_block at line 193: document is None
* literal_block at line 236: document is None
Some other literal_block nodes do have document set though.
Is this normal behavior? I don't remember if I found out about source/line by reading the documentation or by reading nodes.py. I can't seem to find a description the docs at this moment.
For now, if document is None, I (recursively) try to get the document from the parent node. Same for line.