From: Andrew M. Kuchling Date: Mon, 1 Mar 2010 20:11:57 +0000 (+0000) Subject: #7637: avoid repeated-concatenation antipattern in example X-Git-Tag: v2.7a4~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe6f07c0acda9f93179e25710e16368212f56a65;p=thirdparty%2FPython%2Fcpython.git #7637: avoid repeated-concatenation antipattern in example --- diff --git a/Doc/includes/minidom-example.py b/Doc/includes/minidom-example.py index c30c4e08a942..4bca949f71fd 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 ""