On Tuesday, October 8, 2002, at 08:58 PM, Joel Shprentz wrote: > At 10:46 AM 10/8/02, Greg Ward wrote: >> IOW, I would favour >> >> def foo(...): >> define a regular function >> >> template foo [plain] (...): >> define a template that returns plain (un-marked-up, needs-to-be- >> quoted-if-included-in-HTML) text >> >> template foo [html] (...): >> define a template that returns HTML text > > I agree with Greg on distinguishing templates, which return > concatenated expression values, and functions, which return None or > some specified value. > I disagree with this notion. Templates and functions are not distinguished by what types of things they return: either may return anything. The distinction is only in what they do with statements whose values are string (-like), and in what they return by default. A template really *is* a function written in a convenient format. The answer to the question of how to make sure the reader notices when templates are being used is not so clear to me. "template foo [html] " seems okay, but I prefer "def foo [html]". The word in brackets makes these defs stand out sufficiently, I think. I also like it for being slightly more compact, and because emacs will colorize the def form without any special customization. ;)