[Python-Dev] Global interpreter lock/import mechanism

Greg Ward gward@python.net
Thu, 30 Jan 2003 18:49:41 -0500


On 30 January 2003, Joerg Budischewski said:
> 2) I would like to hook into the python import mechanism in order to 
> introduce new classes. I currently do this by replacing the 
> __builtin__.__dict__["__import__"] with my own version, which delegates 
> to the original function and in case of failure tries to lookup a UNO type.
[...]
> However, I think, the replace-__import__-function is quite a nasty 
> solution, I would rather like to have an API for this. Is there an API I 
> have overlooked (or is it planned to have something like that ? ).

This has got to be one of the all-time most-discussed topics on
python-dev.  Check the archive for last November/December for an
enormous discussion.

> But currently, the python unix buildprocess does not create a shared 
> library, only a static lib (while on windows a shared library gets built).
> 
> Are there any plans to add also a shared libs for unix  ?

Take a look at the Debian package for Python.  I don't know exactly how
they do it, but I have /usr/lib/libpython{1.5,2.1,2.2}.so on my system.
Nice.

        Greg
-- 
Greg Ward <gward@python.net>                         http://www.gerg.ca/
I had a ploughman's lunch the other day.  He wasn't very happy.