On 12.09.12 00:47, Victor Stinner wrote: >> x = x + [y] => x.append(y) >> x = x + [y, z] => x.extend([y, z]) > > It behaves differently if x is not a list, but str for example. Actually even worse. Transformations applicable only if x has not aliases. Pseudocode: if type(x) is list and refcount(x) == 1: list.append(x, y) else: x = x + [y] This optimization can be done only in the interpreter, otherwise overhead costs will be too high.
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