Re: Standard module implementation

On Sun, Nov 28, 2010 at 6:08 AM, candide <candide@xxxxxxxxxxxx> 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
import pickle # pure Python version


Relevant Pages

  • Re: About one class/function per module
    ... "the majority of programmers don't use this approach". ... You obviously don't have enough experience with Python to understand why your "organization" suck. ... (snip lots of stuff that require neither "one line of code per file" nor fancy scripts) ...
  • Re: Why learn Python ??
    ... >> great majority of projects, optimisation does not require ... Most code in Python, plus small amount of C/C++ ... and that ratio applies to 90% of the project. ...
  • Re: Python 3000 vs. Python 2.x
    ... learning. ... I've read that a number of significant features have ... Yet, the majority of Python ...
  • Re: Why does Python never add itself to the Windows path?
    ... Unlike Unix systems, the PATH variable is rarely used. ... It is not less than the majority of Python users who deal with multiple Python versions. ... install Python to the path? ...
  • Re: Python 3000 vs. Python 2.x
    ...  I've read that a number of significant features have ...  Yet, the majority of Python ... What 3rd party modules are you planning to use? ... Python 3000 versions. ...