[Python-Dev] Supporting Third Party Modules (was The other Py2.4 issue)

Bob Ippolito bob at redivi.com
Sat Dec 11 10:51:30 CET 2004


On Dec 11, 2004, at 3:39 AM, Martin v. Löwis wrote:

> Chui G. Tey wrote:
>> One good way of helping out is to provide an dynamic loading function
>> that third party modules could access the basic python functions such 
>> as
>> PyArgParseTuple, PyString_AsString etc regardless of which python the
>> user is running. This would be similar to the COM approach. You can 
>> load
>> all the function pointers into a struct and then call them. Third 
>> party modules would link against this DLL independent of which
>> python is being used.
>
> I believe this is not implementable: How can the DLL know which Python
> DLL to use?

Well for py2app on Mac OS X, I wrote an executable stub that chooses a 
Python runtime from an XML file, looks up and binds a few symbols from 
it dynamically, and then starts doing stuff.  Works for 2.3 (as long as 
it's not compiled debug or trace refs) and 2.4 (universally, because it 
has exported functions for incref and decref).

For extension modules, this makes much less sense, but I wanted to be 
able to bootstrap Python programs with a precompiled executable that I 
didn't have to maintain across several versions.

-bob



More information about the Python-Dev mailing list