【源码】PyObject_VAR_HEAD 定长对象 变长对象

PyObject_VAR_HEAD 
 
 
Python-3.7.4Includeobject.h
 
/* PyObject_VAR_HEAD defines the initial segment of all variable-size
 * container objects.  These end with a declaration of an array with 1
 * element, but enough space is malloc'ed so that the array actually
 * has room for ob_size elements.  Note that ob_size is an element count,
 * not necessarily a byte count.
 */
#define PyObject_VAR_HEAD      PyVarObject ob_base;
 
 
 
原文地址:https://www.cnblogs.com/rsapaper/p/8352999.html