How is tuple implemented in CPython?

前端 未结 3 1340
慢半拍i
慢半拍i 2020-11-29 03:54

I\'ve been trying to learn how CPython is implemented under the scenes. It\'s great that Python is high level, but I don\'t like treating it like a black box.

With

3条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 04:39

    Thanks to templatetypedef's Answer! I was curious about the exact value of PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST, so I used google and found it out:

    enter image description here

    https://github.com/python/cpython/blob/master/Objects/tupleobject.c

    google search keyword: PyTuple_MAXSAVESIZE site:github.com

提交回复
热议问题