[issue36229] Linear-time list, set, and bytearray ops.
Serhiy Storchaka
report at bugs.python.org
Tue Mar 12 04:46:18 EDT 2019
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
This is an interesting idea. But I have two concerns.
1. It is hard to implement refcount-based optimization on Python implementations which do not use reference counting (i.e. PyPy). If the effect of this optimization will be significant, people will become writing a code that depends on it, and this will cause problems on other implementations.
2. Currently list1 + list2 + list3 returns a list which allocates the exact amount of memory needed to contain its content. But with the proposed changes the result list could preallocate more memory. If the result is a long living object, this can cause to wasting of memory.
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36229>
_______________________________________
More information about the Python-bugs-list
mailing list