Skip to content

Generalise isinstance dict check #185

Open
@martinpengellyphillips

Description

@martinpengellyphillips

I have a 'dict' like class that actually implements the Python collections.MutableMapping interface. However, pystache will not render templates correctly with this object as it is not considered a dict by the check in _get_value (https://github.com/defunkt/pystache/blob/master/pystache/context.py#L46).

At present I have resorted to also inheriting from dict in my class, but it would be good if this check could be improved (perhaps also test for Mapping interface conformity).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions