为什么 Python 需要两个存储块

Why Python needs two storage blocks

为什么 Python 中的列表需要两个存储块?

List is stored in two blocks of memory (One is fixed-sized and the other is variable-sized for storing data)

是不是一个block存放根地址,另一个block是为了跟踪链表的动态变化?

将列表拆分为 fixed-size 元数据 header 和 variable-size 数据缓冲区可以重新分配数据缓冲区,而不会使其他代码持有的指针无效,因为其他代码仅持有指向的指针元数据 header.