[issue4612] PyModule_Create() doesn't add/import module

Brett Cannon report at bugs.python.org
Tue Dec 9 23:36:33 CET 2008


Brett Cannon <brett at python.org> added the comment:

On Tue, Dec 9, 2008 at 14:34, Amaury Forgeot d'Arc
<report at bugs.python.org> wrote:
>
> Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
>
> When python is embedded in a program, there must be a way for the
> program to export
> some of its functions to python - a module that resides in the main
> executable.
>
> You cannot use the import machinery to import such a module, because
> there is no
> separate file to find and load. Instead, the embedding program
> explicitly calls the
> module init() function.
> With python 2.x, this creates the module *and* inserts it into
> sys.modules. Then
> subsequent imports will find it directly in sys.modules.
>
> mod_python for example works this way.
> I maintain that the sample is still valid, and should be made to work
> somehow.

That's what I mean; the example is off as in incorrect. Not off as in
trying to do something silly.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4612>
_______________________________________


More information about the Python-bugs-list mailing list