How does Python allocate memory for objects of classes derived from C types?
问题 Suppose we have created a Python module in C _xxx that contains an extension object xxx , and we do following: import _xxx class derived(_xxx.xxx): # ... d = derived() How does Python allocate memory for d behind the scenes? Eli Bendersky's article Python object creation sequence is the closest I've found, but it doesn't appear to cover this scenario. NOTE: there is already an answer HERE: I'm going to ask the author if he will consider migrating his answer here, as it is a good answer to a