Metaclass mystery

LittleGrasshopper seattlehanks at
Mon Jun 1 13:18:22 EDT 2009

On Jun 1, 12:42 am, Michele Simionato <michele.simion... at>
> On May 31, 2:32 am, LittleGrasshopper <seattleha... at> wrote:
> > Seriously, metaclasses are making my brain hurt. How do people like
> > Michele Simionato and David Mertz figure these things out? Does it all
> > come to looking at the C source code for the CPython interpreter?
> Actually I never looked at the C source code. I performed lots of
> experiments
> and figured things out the hard way, with trial and errors.
> Metaclasses
> are not that hard, descriptors and super were much harder to grasp at
> that
> time, since there was next to zero documentation and a set of subtle
> bugs.
> For descriptors now there is Raymond Hettinger essay and for super
> there are my blog posts
> on Artima:
> (there are also two posts of mine about metaclasses in Python 3.0 that
> you may want to
> read)
> HTH,
>             Michele

I have to thank you for all the invaluable materials you have provided
to the python community. The process that you followed must have been
incredibly arduous. A while back I gathered a lot of papers, many of
which you either authored or co-authored, and they have been a great
help. Just yesterday I went through your paper on the MRO on the
advice of Carl Banks, and it absolutely clarified how the C3 MRO rules
work. Once you understand how the MRO works it is actually quite
intuitive, and your paper helped me understand this.

Thanks for pointing your Artima papers on super(). A few days ago I
hit a brick wall due to the terminology used regarding "bound" and
"unbound" super objects, so I went on a search for suitable materials,
and of course I found your papers on super(). I skimmed through them
enough to understand the issues that were escaping me at the moment,
but I intend to go through them completely at some point. It was quite
fortunate that your papers acted as a catalyst for the change of the
official documentation on super() in 2.6. The original documentation
was very misleading.

As you mentioned, Raymond Hettinger paper on descriptors is excellent
as well, and I highly recommend it.



More information about the Python-list mailing list