bpo-36229: Avoid unnecessary copies for list, set, and bytearray ops. by brandtbucher · Pull Request #12226 · python/cpython

added 4 commits

March 7, 2019 12:49
If a list, set, or bytearray object's refcount is exactly one, binary operations delegate to their in-place counterparts, rather than creating expensive copies.
This removes the need for separate declarations of in-place functions.
This still tests that the list constructor efficiently allocates space...  it just might not be *exactly* the same size as the given example, as was implied before.

@blurb-it

@brandtbucher brandtbucher changed the title bpo-36229: Linear-time ops for some mutable collections. bpo-36229: Linear-time list, set, and bytearray ops.

Mar 11, 2019

@brandtbucher brandtbucher changed the title bpo-36229: Linear-time list, set, and bytearray ops. bpo-36229: Avoid unnecessary copies for list, set, and bytearray ops.

Mar 13, 2019