defunkt/pystache — Issue #69: Remove markupsafe dependency
Author: cjerdonek
Created: 2011-12-25 15:27:46+00:00
State: open

Markupsafe is currently used in just two places in the code: (1) to provide [`Renderer.__init__()`](https://github.com/defunkt/pystache/blob/development/pystache/renderer.py#L91) with a custom escape function, and (2) to wrap the return value of `Renderer.render()` in a custom class [in the last line](https://github.com/defunkt/pystache/blob/development/pystache/renderer.py#L221) of the rendering process. (1) and (2) can both be easily done by the caller. Removing markupsafe has the benefit of removing a dependency on an external library. Also, requiring the user to provide the custom escape function is more consistent with Python's philosophy of "explicit rather than implicit." Using the `try: import ... except: pass` pattern has the disadvantage that the user doesn't know whether markupsafe will be used or not. Better to have the user specify and not fail silently.