On 2013-10-21, Marcin Szamotulski <msza...@gmail.com> wrote: > So the process (with some simplifications) goes like this: > > 1. get metaclass: meta > 2. call meta.__prepare__ to get namespace (class __dict__) > 3. evaluate the class body in the namespace > 4. call meta with arguemnts: name, bases, namespace > (when you instantiate any class in Python, metaclass is just > a class, first its __new__ method is called, and then its __init__) > > All this is in builtin__build_class__.
In addition, the Python manual describes the process in detail. See The Python Language Reference 8.7 Class definitions. Here's a link to the 3.3 version of those docs: http://docs.python.org/3.3/reference/compound_stmts.html#class-definitions -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list