Chetan Pandya wrote: > My statement wasn't clear enough. > > Rendering occurs if the string being concatenated is already a > concatenation object created by an earlier assignment. > I'm not sure how you came to that conclusion. My reading of the patch doesn't suggest that at all. The operation of string_concat would not produce what you suggest. I can't find anything anywhere that would cause the behavior you suggest. The only case where this is true is if the depth of the tree is too great. To revisit your example, I will notate concats as string pairs: a = "Value a =" # new string a += "anything" # ("Value a =", "anything") c = a + b # (("Value a =", "anything"), b) c += "Something" # ((("Value a =", "anything"), b), "Something" So again, for your other example of repeated right-hand concatenation, you do not continually render the concat object, you merely create new one and attach to the leaves. Once the print is executed, you will force the rendering of the object, but only once that happens. So in contrast to your statement, there are actually there are fewer allocations of strings and smaller objects being allocated than the current trunk uses. -- Scott Dial scott at scottdial.com scodial at cs.indiana.edu -- Scott Dial scott at scottdial.com scodial at cs.indiana.edu
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4