[capi-sig] Creating type object dynamically in run-time
mateusz at loskot.net
Thu May 10 14:52:30 CEST 2012
On 10 May 2012 13:37, Mateusz Loskot <mateusz at loskot.net> wrote:
> On 10 May 2012 13:00, Stefan Behnel <python_capi at behnel.de> wrote:
>> Mateusz Loskot, 10.05.2012 13:47:
>>> Now, I'd like to add some types which are generated in run-time, way
>>> before the 'emb' module is appended to inittab and embedded Python is
>> Why would you want to do that before initialising the Python runtime?
> The 'emb' must be added to inittab before Python is initialised (that's what the
> manual says, isn't it.) So, the scheme is this:
> /* 1. Dynamically generate emb.GeneratedNoddy */
> ... /* Trying to figure out how */
> /* 2. Register 'emb' module as built-in */
> PyImport_AppendInittab("emb", &PyInit_emb);
> /* 3. Initialise Python */
> /* 4. we're ready to use */
> /* 5. Clean-up */
> Does it make sense?
I recall the explanation above.
It is not necessary to place extension types construction
before the PyImport_AppendInittab and Py_Initialize, of course.
Mateusz Loskot, http://mateusz.loskot.net
More information about the capi-sig