[Python-Dev] _PyImport_LoadDynamicModule questions
Martin v. Loewis
30 May 2002 00:35:11 +0200
"David Abrahams" <email@example.com> writes:
> On AIX, building a shared library for use by extension modules and which
> uses the Python 'C' API is way harder than it should be**; the best
> workaround we could find involves hijacking _PyImport_LoadDynamicModule to
> load the shared library and patch up the symbol references.
> _PyImportLoadDynamicModule is undocumented, AFAICT. Am I not supposed to
> touch it? Is it likely to disappear or change its signature?
As Guido explains, you should not use it in an extension module: it
may go away without notice, or change its signature.
As for dynamic linking on AIX: It would be really good if somebody
stepped forward who claims to understand the dynamic loader of AIX,
and rewrite Python to make this work more "nicely". Before starting
the rewrite, I'd be really curious to hear the full story of why it
currently is the way it is, and how this state could be improved. If
you find that a "good" redesign requires a shared libpython, then so
be it - but I'm still quite fond of the "single executable" appraoch,
so preserving that would be even better.