Creating C modules for Python under Cygwin

Martin v. Loewis martin at v.loewis.de
Sun May 5 18:10:56 EDT 2002


Alex Martelli <aleax at aleax.it> writes:

> I don't know if there are all that many .EXE's embedding Python on
> Windows, nor if that was the reason for the (perfectly reasonable)
> choice to build Python itself as a DLL there.  

I feel the choice of putting Python into a DLL is questionable,
atleast for the following reasons:

- you force extension modules to tie themselves to a specific version
  of the Python DLL. This means that there is zero chance that you can
  exchange extension modules across Python releases - even though the
  Python interpreter itself allows for such sharing (on other
  platforms).

- when freezing Python applications, I would like to have a static
  library, not a shared one, so that I get a stand-alone binary.

OTOH, the "we can embed Python" argument is not so strong as it may
seem: when you embed Python, you still need some glue code for the
container; that glue code could easily link with a static library,
instead of a shared one. Of course, then the question is what to link
extension modules against.

Regards,
Martin




More information about the Python-list mailing list