>>> import pybars
>>> comp = pybars.Compiler()
>>> fn = comp.compile(u"{{test.items}}")
>>> fn({"test": {"items": [1,2,3]}})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_templates/_template_1.py", line 26, in render
TypeError: items() takes no arguments (1 given)
It's possible to access the dict entry through lookup, but IMO it shouldn't be the only way just because of a naming conflict with a built-in class function. Maybe pybars3 should check for dict-ness before invoking hasattr()?
(relevant lines)
I've noticed something strange while upgrading a larger project from pybars to pybars3:
pybars 0.0.4:
pybars3 0.9.1:
It's possible to access the dict entry through
lookup
, but IMO it shouldn't be the only way just because of a naming conflict with a built-in class function. Maybe pybars3 should check for dict-ness before invokinghasattr()
? (relevant lines)