summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Florenzano <floguy@gmail.com>2009-10-30 13:12:27 -0700
committerEric Florenzano <floguy@gmail.com>2009-10-30 13:12:27 -0700
commit729b2e2cd2652450244f5ad129c3d258f8aa7319 (patch)
tree4750175c52c4614e41697ed400dcf109caaae992
parent5ce9ac220d2f7da5e1037c7ad7f9bed1a8d2e7c5 (diff)
downloadpystache-729b2e2cd2652450244f5ad129c3d258f8aa7319.tar.gz
Made the same changes to the module-level render method.
-rw-r--r--pystache/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pystache/__init__.py b/pystache/__init__.py
index 913dc61..bb832b8 100644
--- a/pystache/__init__.py
+++ b/pystache/__init__.py
@@ -1,8 +1,7 @@
from pystache.template import Template
from pystache.view import View
-def render(template, context={}, **kwargs):
- context = context.copy()
- for key in kwargs:
- context[key] = kwargs[key]
+def render(template, context=None, **kwargs):
+ context = context and context.copy() or {}
+ context.update(kwargs)
return Template(template, context).render()