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 badly formed question. i.e. He's figured out what question I needed to ask and answered it. But it's going to be difficult for someone else to find the resource, so I think it's better to match it with an appropriate question.
Other answers of course welcome, but just please check the above link first to make sure it isn't already covered! Also any comments to the existing answer, please could you wait until it is relocated (if the author chooses to relocate it).