Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

Why should that be backwards incompatible? The number of times we can `__len__` 
on the constructor is an implementation detail. The reason is called now twice 
is because there is an extra check for the preallocation logic, which is 
detached from the logic of the subsequent list_extend(self, iterable). 

On the other hand, there may be a chance for optimization here, but on a very 
rough first plan, that may require coupling some logic (passing down the 
calculated length to list_extend() or some helper, which I am not very fond of.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39829>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to