nodes.doc.content = '(block | whatever)+'
nodes.doc.content = '(block | whatever[level=1])+'
gives you: SyntaxError: Invalid content expression
SyntaxError: Invalid content expression
Is this by design as of today?
Attribute constraints should go outside of the parentheses, which is bad, but they are going away entirely so please don't start relying on them.