A while back, I wrote a very small Python HTML rendering library that gives some of the benefits of this notation while still being Python source code. You _may_ find it interesting if this is the sort of thing you find interesting...
http://hotwax.cjmunday.com/python.html#sec-1.2
See the CherryPy file browser example later in the page for a demonstration of how it's used.