noahmorrison / chevron

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

Allow field access for namedtuple in Python 3 #73

Closed tchebb closed 3 years ago

tchebb commented 4 years ago

namedtuple in Python 3 does not provide a __dict__ attribute. See https://bugs.python.org/issue24931 for rationale why. As such, if we want to render keys in namedtuples, we need to use its _asdict method.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 2a9dcdeb8fefae44de19a94d09bffb44eadd9e13 on tchebb:fix-py3-namedtuple into 78f1a384eddef16906732d8db66deea6d37049b7 on noahmorrison:master.

noahmorrison commented 3 years ago

@tchebb merged