Class construction

D

Demian Brecht

Hi all,

I'm trying to wrap my head around how classes are constructed at the
interpreter level (as a side effect of digging into metaclasses) and
I'm hoping to have my investigation either validated or ridiculed ;)

The pipeline that I've figured through some gdb debugging (starting at
type_call):

+ type_call
+ is there a metaclass for this object?
+ return metaclass->tp_new
+ roughly 350 LOC constructing the type
+ is object is not a subclass of type?
+ return object
+ call obj->tp_init

Does that sound correct? My C/gdb skills are horribly rusty at this
point so expert insight would help :)

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top