Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57195

Class construction

Date 2013-10-21 08:08 -0700
Subject Class construction
From Demian Brecht <demianbrecht@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1312.1382368108.18130.python-list@python.org> (permalink)

Show all headers | View raw


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,

-- 

Demian Brecht
http://demianbrecht.github.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Class construction Demian Brecht <demianbrecht@gmail.com> - 2013-10-21 08:08 -0700

csiph-web