hello Stefan,
> This may indicate that the generated C++ code actually interfaces with
> CPython. Maybe Kay can clear this up.
Well, the core of building a class, is e.g. this code:
PyObject *result = PyObject_CallFunctionObjArgs( metaclass,
class_name, bases, dict, NULL );
So, I let CPython call the metaclass, and do not yet even attempt to get
in its way with it. So support for metaclasses sounds big, but actually
was small enough.
The only difficulty is selecting the metaclass from the given bases if
not specified. Then set a couple of attributes, much like the code in
CPython does, that builds a class.
So well, yes, behind meta classes is nearly nothing. The hard work was
functions/generators and closures. Once these are like normal functions,
they can be used in classes, and it works without any optimization. I
just need to have code some places, where the C-API does not expose
details the CPython core takes care of.
Rest assured, the project was simple enough for one person. :-)
Yours,
Kay
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev