I don't quite get an abstraction like this, if in the end both in our minds and through [trans|com]piler it's necessary to know the underlying abstraction in details(?)
The benefit comes as you're generating chunks in python, then you're passing around python objects rather than strings, string templates, etc.
It's also a bit of an odd thing to be in python, then just because you need to loop you need to write Jinja or other templates which are different languages basically. Might be nicer to write a loop in python.