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


Groups > comp.lang.python > #57195 > unrolled thread

Class construction

Started byDemian Brecht <demianbrecht@gmail.com>
First post2013-10-21 08:08 -0700
Last post2013-10-21 08:08 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#57195 — Class construction

FromDemian Brecht <demianbrecht@gmail.com>
Date2013-10-21 08:08 -0700
SubjectClass construction
Message-ID<mailman.1312.1382368108.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web