diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2010-03-01 20:11:57 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2010-03-01 20:11:57 (GMT) |
commit | fe6f07c0acda9f93179e25710e16368212f56a65 (patch) | |
tree | ffeaa803dbb77c4dfeb065a052b1cc6f4816687a /Doc/includes/minidom-example.py | |
parent | 66dab172fecb118c0fc7b191763a28e071e14a58 (diff) | |
download | cpython-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.py | 6 |
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>" |