Why are Python lists implemented as dynamic arrays instead of ring buffers?

A listin Python is now implemented as a dynamic array of pointers, so it is not suitable for insertion and deletion at the front end. However, the ring buffer also supports O (1) indexing. It can also expand and contract as a dynamic array to support O (1) cushioned insertion and deletion from both ends. Why didn’t CPython choose this implementation or the main disadvantage of this?

+4
source share

No one has answered this question yet.

Source: https://habr.com/ru/post/1670310/


All Articles