6. Python3源碼—List對象

6.1. List對象

List對象是「變長對象」。spa

6.1.1. Python中的建立

Python中List對象最重要的建立方法爲PyList_New,以下Python語句最終會調用到PyList_New:code

test = [1, 2, 3, 4, 5]

6.1.2. PyList_New的C調用棧

// pystate.c
PyInterpreterState_New

// ceval.c
=>_PyEval_EvalFrameDefault (case BUILD_LIST)

// listobject.c
=> PyList_New

6.1.3. PyList_New源碼

相關文章
相關標籤/搜索