summaryrefslogtreecommitdiffstats
path: root/Doc/includes/minidom-example.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2010-03-01 20:11:57 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2010-03-01 20:11:57 (GMT)
commitfe6f07c0acda9f93179e25710e16368212f56a65 (patch)
treeffeaa803dbb77c4dfeb065a052b1cc6f4816687a /Doc/includes/minidom-example.py
parent66dab172fecb118c0fc7b191763a28e071e14a58 (diff)
downloadcpython-fe6f07c0acda9f93179e25710e16368212f56a65.zip
cpython-fe6f07c0acda9f93179e25710e16368212f56a65.tar.gz
cpython-fe6f07c0acda9f93179e25710e16368212f56a65.tar.bz2
#7637: avoid repeated-concatenation antipattern in example
Diffstat (limited to 'Doc/includes/minidom-example.py')
-rw-r--r--Doc/includes/minidom-example.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/includes/minidom-example.py b/Doc/includes/minidom-example.py
index c30c4e0..4bca949 100644
--- a/Doc/includes/minidom-example.py
+++ b/Doc/includes/minidom-example.py
@@ -19,11 +19,11 @@ document = """\
dom = xml.dom.minidom.parseString(document)
def getText(nodelist):
- rc = ""
+ rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
- rc = rc + node.data
- return rc
+ rc.append(node.data)
+ return ''.join(rc)
def handleSlideshow(slideshow):
print "<html>"