From 6179c02c91800d220de03006117afa5e6d60f0f6 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Fri, 23 Jan 2015 10:12:10 +0000 Subject: [PATCH] Replace lambda for 'dict' in with dict itself lambda **kw: kw is not equivalent to the dict constructor. It is much less useful. In particular it doesn't accept a sequence of pairs. Why not put dict itself into the DEFAULT_NAMESPACE? Principle of least surprise, etc. --- jinja2/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jinja2/defaults.py b/jinja2/defaults.py index a27cb80c..3717a722 100644 --- a/jinja2/defaults.py +++ b/jinja2/defaults.py @@ -32,7 +32,7 @@ from jinja2.tests import TESTS as DEFAULT_TESTS DEFAULT_NAMESPACE = { 'range': range_type, - 'dict': lambda **kw: kw, + 'dict': dict, 'lipsum': generate_lorem_ipsum, 'cycler': Cycler, 'joiner': Joiner