Standard module implementation

Chris Rebert clp2 at
Sun Nov 28 21:54:44 CET 2010

On Sun, Nov 28, 2010 at 6:08 AM, candide <candide at free.invalid> wrote:
> I was wondering if all the standard module are implemented in C. For
> instance, I can't find a C implementation for the minidom xml parser under
> Python 2.6.

As was already said, no; a significant portion if not the majority of
the std lib is written in pure Python, not C.

You can usually determine how a module is implemented by looking at
the file extension of the module's __file__ attribute. For example:
$ python
Python 2.6.6 (r266:84292, Oct 12 2010, 14:31:05)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle # obviously in C
>>> cPickle.__file__
>>> import pickle # pure Python version
>>> pickle.__file__


More information about the Python-list mailing list