pystache
pystache copied to clipboard
Support mappings that are not simply dicts.
As part of a recent project I needed Pystache to work with a custom class that followed the collections.Mapping spec and was not directly subclassed from dict. As a result, Pystache wouldn't retrieve items from the mapping. This patch fixes the context to test type against collections.Mapping rather than dict.
Thanks for the suggestion and patch. Can you add a test, too? It would also be good to add a code comment to explain why collections.Mapping
is used instead of dict
(and perhaps referencing this issue number).
Will do.
Added docs and unit tests. Let me know if anything else is needed?
Hey @cjerdonek, you asked what issue people would want fixed in a new release and for me this is the one :)