> As a test case, how would I implement the case that has come up here > recently, of supporting $obj.attr substitutions, in each of the two > implementations? It would be interesting to see the relative > simplicity. I'm assuming that the function-based case would require > effectively a cut & paste reimplementation. > > [FX: Dives into source code...] > The Template class is pretty trivial, but it doesn't seem to be > designed for extension. Thus, the above test case would *still* need > pretty much a rewrite. However, if the Template class was rewritten > with overriding in mind, it probably could make things easier: Subclassing is only one possibility. With the templating version, you could also write another class that implements the same interface -- very Pythonic. If Raymond's function approach were chosen, you're stuck with what that function can and can't do. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4