Skip to content
New issue

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

Support mappings that are not simply dicts. #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

martinpengellyphillips
Copy link

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.

@cjerdonek
Copy link
Collaborator

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

@martinpengellyphillips
Copy link
Author

Will do.

@martinpengellyphillips
Copy link
Author

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

@ludovicchabant
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants