[Python-3000] Questions about PEP 3121

Brett Cannon brett at python.org
Wed Sep 5 02:54:44 CEST 2007


I am prepping for a presentation on Python 3.0 that I am giving
tonight and I had some questions about PEP 3121 that the example
creates.

First is whether the name of the function that returns the
module-specific memory is PyModule_GetData() or PyModule_GetState()?
The former is listed by the PEP but the latter is used by the example.

Second is how are the exception and type to be added to the module?
Currently one uses PyModule_AddObject() to insert an object into the
global namespace of a module.  But the example leaves that out and I
wanted to make sure there was not some magical new step left out
(initializing Xxo_Type is also left out, but that does not directly
deal with module initialization).

Lastly, what is tp_reload to be used for?  The PEP doesn't say but the
PyModuleDef lists it.  I assume it is to be called when a module is
reloaded, but it is not specified in the PEP.

-Brett


More information about the Python-3000 mailing list