noahmorrison / chevron

A Python implementation of mustache
MIT License
505 stars 55 forks source link

List rendering is overly restrictive #33

Closed gber closed 6 years ago

gber commented 6 years ago

Currently rendering of lists is very restrictive as it only accepts python's built-in list type. IMHO that is not pythonic since it does not allow for duck typing or even subclasses of list. This causes problems for me when I pass YAML data parsed by ruamel.yaml into it which uses list-like types for YAML lists. AFAICS it should not be a problem to check for any iterable type (except a str in python3) instead and then loop over it.

bugadani commented 5 years ago

I still have an issue with this one since I work with some types (like dict key or value views) that I have to cast to list before passing to render.

noahmorrison commented 5 years ago

@bugadani Would you mind opening a new issue with a specific example of the bad behavior?