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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe6f07c0acda9f93179e25710e16368212f56a65;p=python #7637: avoid repeated-concatenation antipattern in example --- diff --git a/Doc/includes/minidom-example.py b/Doc/includes/minidom-example.py index c30c4e08a9..4bca949f71 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 ""