pystache icon indicating copy to clipboard operation
pystache copied to clipboard

Support mappings that are not simply dicts.

Open martinpengellyphillips opened this issue 11 years ago • 4 comments

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.

martinpengellyphillips avatar Mar 14 '13 12:03 martinpengellyphillips

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).

cjerdonek avatar Mar 17 '13 23:03 cjerdonek

Will do.

martinpengellyphillips avatar Mar 18 '13 00:03 martinpengellyphillips

Added docs and unit tests. Let me know if anything else is needed?

martinpengellyphillips avatar Mar 21 '13 11:03 martinpengellyphillips

Hey @cjerdonek, you asked what issue people would want fixed in a new release and for me this is the one :)

ludovicchabant avatar Jun 27 '15 15:06 ludovicchabant