On May 31, 2:32 am, LittleGrasshopper <seattleha...@yahoo.com> 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: http://www.artima.com/weblogs/index.jsp?blogger=micheles&start=45&thRange=15 (there are also two posts of mine about metaclasses in Python 3.0 that you may want to read) HTH, Michele -- http://mail.python.org/mailman/listinfo/python-list