defunkt/pystache — comment on commit 75254d671adcf0cbc56a9c86cb831d6b5a7676dc
File:  line 0
By cjerdonek:

Thanks. Assuming that `render()` returned a unicode string, would it have been possible for you to pass the return value to `markupsafe.Markup()` -- say by subclassing View or Template and overriding the render method? The `try: import ... except: pass` pattern isn't ideal in certain ways because the end-user doesn't know whether the import succeeded or not (it's implicit rather than explicit).

Also, did you care about the differences between `cgi.escape()` and `markupsafe.escape()`, or was that less important to you? I understand that markupsafe's escape, for example, escapes [both single quotes and double quotes](https://github.com/mitsuhiko/markupsafe/blob/98caea1496846935dd60a0e170c401e91ce9029a/markupsafe/_native.py#L21) while cgi.escape() by default [does not](http://docs.python.org/library/cgi.html#cgi.escape).