We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Following the "it's Easier to Ask Forgiveness than Permission" principle, is it possible to modify 2 lines in pystache.context:_get_value ?
if isinstance(context, dict): try: return context[key] except KeyError: pass
This would make it possible to pass a collections.defaultdict to pystache.render, which does not work currently:
collections.defaultdict
pystache.render
pystache.render("Hello {{}} !", defaultdict(lambda: "Anonymous visitor"))
The text was updated successfully, but these errors were encountered:
Currently I use this ugly workaround to perform what I want:
class DefaultDictContainsEverything(defaultdict): def __contains__(self, item): return True pystache.render("Hello {{}} !", DefaultDictContainsEverything(lambda: "Anonymous visitor"))
Sorry, something went wrong.
No branches or pull requests
Hi,
Following the "it's Easier to Ask Forgiveness than Permission" principle, is it possible to modify 2 lines in
pystache.context:_get_value ?
This would make it possible to pass a
collections.defaultdict
topystache.render
, which does not work currently:The text was updated successfully, but these errors were encountered: