Tuesday, January 20, 2009

Evoque Templating v0.4 for Python 3.0

Version 0.4 of Evoque Templating is out. Highlights include:

  • Support for Python 3.0
    The same Evoque code base now runs on Python 2.4, 2.5, 2.6 and 3.0 -- possibly making Evoque the first full-featured template engine available for Python 3.0. Behaviour is identical on all four Python versions.

  • Tighter lockdown of the in-process sandbox (restricted mode)
    Primarily by an elaborated runtime scan of all expressions that are passed for evaluation. See the overview of how Evoque implements the in-process sandbox. And yes, do interpret this as an open challenge and invitation to try and break it , and, in the unlikely chance that you succeed, you may request anything you like as compensation, as long as it is beer ;-) Want a quick and dirty script to run devious templates?

  • Revision of whitespace handling
    Notably, reworked the meaning of the slurpy_directives=True mode to be more what most people seem to expect.

  • Continued speed improvements
    More minor performance optimizations. Evoque is fast, and is a real contender for the dubious but gratifying honour of overall fastest pure-python template engine. Included in the distribution are 3 benchmarks -- you can see the measured results on OS X 10.5 for Python 2.6.1 (as there is not much to benchmark against on Python 3.0) -- those numbers are a real tribute to python's conceptual integrity -- that rewards a straightforward implementation of a simple design with... amazing performance.

See full changelog. It is curious to note that all those changes added a whopping 20 SLOC to the 972 count of the preceeding release.