Add required attribute to blocks#1233
Conversation
|
A possible solution is a "look and skip while" method instead, which will keep looking until there are no more of the given type of token. In this case, looking through all names for one that matches the name we're currently looking for, accumulating other names then pushing them all back.
|
Is this for other nodes in general? Hmm, yeah
This sounds like it'll be more useful. I can give it a try
Yeah, one of the earlier iterations tried this. I think the issue I ran into was preventing duplicates like Do you think it would be better to play around with |
|
I'll take a look at this, I need to experiment to see what feels right. |
|
Was looking through the docs, and found another case of a tag having two optional keywords. I think for now the easiest thing to do is just document that |
Awesome! Didn't notice |
5560e4e to
4a3b7a4
Compare
required blocks must be overridden at some point, although not necessarily by the direct child template
4a3b7a4 to
8da77f9
Compare
Resolves #1147
Summary:
scopedmust come beforerequiredif used together)TemplateRuntimeErrorraised otherwise.TemplateSyntaxErrorraised otherwise.TemplateRuntimeError.Test:
test_inheritance.pytest_idtracking.pyto include the new field when instantiating Block nodesFiles affected:
parser.pycompile.pynodes.pytest_inheritance.pytest_idtracking.py