summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Florenzano <floguy@gmail.com>2009-10-29 02:33:36 -0700
committerEric Florenzano <floguy@gmail.com>2009-10-29 02:33:36 -0700
commit8303869d3dc5e667fa0fc42e12627ce1cc6b464f (patch)
tree51bb683fac6c8b8741cfaae47f86ce78c6d44a18
parent554606075b3652bc3f00fcabcde464f05faec4a4 (diff)
downloadpystache-8303869d3dc5e667fa0fc42e12627ce1cc6b464f.tar.gz
String concatenation in Python is bad
-rw-r--r--pystache/template.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pystache/template.py b/pystache/template.py
index f7b620e..f28124d 100644
--- a/pystache/template.py
+++ b/pystache/template.py
@@ -31,12 +31,12 @@ class Template(object):
section, section_name, inner = match.group(0, 1, 2)
if section_name in context and context[section_name]:
if hasattr(context[section_name], '__iter__'):
- insides = ''
+ insides = []
for item in context[section_name]:
ctx = context.copy()
ctx.update(item)
- insides += self.render(inner, ctx)
- template = template.replace(section, insides)
+ insides.append(self.render(inner, ctx))
+ template = template.replace(section, ''.join(insides))
else:
template = template.replace(section, inner)
else: