[Python-Dev] buildin vs. shared modules

Thomas Heller theller at python.net
Fri Oct 17 13:42:59 EDT 2003


Guido van Rossum <guido at python.org> writes:

>> So, would a patch be accepted (for 2.4, I assume there is no way for
>> 2.3.3) which made everything builtin except for the following modules:
>> 
>> _testcapi - not used outside the testsuite
>> _tkinter - needs external stuff anyway
>> pyexpat - may be replaced by a third party module
>> _ssl - needs Python to be built
>
> I'd rather see an explicit list of the "everything" that you want to
> bundle into the main DLL.

Here is the list of Python 2.3 extension modules, in decreasing order of
my preference to be converted into a builtin.

Needed to start Python - should be builtin:

  zlib _sre

Used by myself everyday - would like them to be builtin:

  _socket _winreg mmap select

I'm undecided on these modules, I do not use them now but may in the
future - so I'm undecided:

  _csv winsound datetime bz2

These should remain in separate pyd files for varous reasons:

  _tkinter _bsddb _testcapi pyexpat

Don't know what these do, so I cannot really comment:

  _symtable parser unicodedata

And while we're at it, I have looked at sys.builtin_module_names (again,
from Python 2.3), and wondered if there arn't too many.

I have *never* used any of these (xxsubtype is only a source code
example, isn't it):

  audioop imageop rgbimg xxsubtype

and I guess some of these could also be moved out of python.dll (rotor
is even deprecated):

  _hotshot cmath rotor sha md5 xreadlines

----
There may be incompatibilities - that's why I asked about 2.3.3 or 2.4.

The biggest problem would probably be that you would have to download
additional sources - zlib is one example.

Who cares about the python.dll file getting larger? As Martin explained,
this shouldn't increase memory usage, and since zlib and _sre are loaded
anyway at Python starup, the startup time should decrease IMO.

Let me conclude that I have no pressing need for changing this, but the
decision whether an extension module is builtin or in a dll should
follow a certain pattern.

To reduce the number of files py2exe (or installer) produces the best
way would be to build custom python dlls containing the most popular
extensions as builtins.  Of course this can be done by everyone owning a
C compiler and a text editor.  And my own version would certainly
include _ctypes ;-)

Thomas




More information about the Python-Dev mailing list