Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make nodes.template.Template a bit more dict-like (#252)
* nodes: add a `default` param to Template.get Similar to dict.get, Template.get with a default param supplied will return that value instead of raising an exception. If default is unset, Template.get will keep its previous behavior and raise an exception. * nodes: Add __getitem__, __setitem__, and __delitem__ to Template These are just aliases for existing methods, without the ability to specifiy additional parameters. However, including them makes Template more dict-like, so it's a good idea to have them. * nodes: Use def instead of assignment of a lambda in Template Per PEP8, there is no benefit to using a lambda here, and some downsides. It's the same number of SLOC either way, so might as well change it.
- Loading branch information