A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-September/121690.html below:

[Python-Dev] Release of astoptimizer 0.3

[Python-Dev] Release of astoptimizer 0.3 [Python-Dev] Release of astoptimizer 0.3Serhiy Storchaka storchaka at gmail.com
Wed Sep 12 09:55:38 CEST 2012
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.

More information about the Python-Dev mailing list

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