2 ms·
Python's list type is implemented as a dynamic array in CPython. This is not required. An optimizing Python doing escape analysis could see a list was going to
by ben509 8y ago
Python's list type is implemented as a dynamic array in CPython. This is not required.
An optimizing Python doing escape analysis could see a list was going to be converted to a set and swap in a set and change the method calls. Or it could see a large number of concatenations and use a linked list as an intermediate form.