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

Bob Ippolito bob at redivi.com
Sun Dec 12 18:46:18 CET 2004

On Dec 12, 2004, at 11:02 AM, Martin v. Löwis wrote:

> Bob Ippolito wrote:
>>> 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.
> While that would work, I think this is inappropriate for this specific
> issue: we want to write extension modules which are independent of
> the Python version, and might even be used with multiple Python
> installations on the same system. In that case, adding configuration
> files won't work, as each usage of the extension might require a
> different Python DLL.

Yes, of course, I was talking about the executable, not extensions.  On 
Mac OS X 10.3+, the linker flag -undefined dynamic_lookup allows 
extensions to link to no Python whatsoever.  The extensions will just 
find the symbols it needs from some other image already loaded into the 
process at runtime.  If it weren't for the "forced" ABI 
incompatibility, we'd already have extensions that work 
cross-Python-major-version (assuming they used a safe subset of 
functions and structures).


More information about the Python-Dev mailing list