[Python-Dev] buildin vs. shared modules
tim.one at comcast.net
Fri Oct 10 23:52:49 EDT 2003
> What is the rationale to decide whether a module is builtin or an
> extension module in core Python (I only care about Windows)?
I don't know that there is one. Maybe to avoid chewing address space for
code that some programs won't use. Generally speaking, it appears some
effort was made to make stuff an extension module on Windows if it was an
optional part of the Unix build. There was certainly an effort made to
build an extension for Python modules wrapping external cod (like the _bsddb
and _tkinter projects).
> To give examples, could zlib be made into a builtin module (because
> it's useful for zipimport), _sre (because it's used by warnings), or
> are there reasons preventing this?
zlib was there long before Python routinely made use of it; indeed, I doubt
I ever used one byte of the zlib code outside of Python testing before zip
import came along (and since I have no zip files to import from I guess I
still never use it). Leaving _sre an extension seems odd now, but at the
time it was competing with the external-to-Python PCRE code.
Why do you ask? Answers must be accurate to 10 decimal digits <wink>.
More information about the Python-Dev