Standard module implementation

C

candide

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.
 
B

Benjamin Kaplan

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.
--

No they aren't. A good chunk of the standard library is implemented in
Python. Which is nice because Python the language isn't only
implemented in C (CPython, the main implementation). It's also
implemented in Java (Jython), C# (IronPython), and even in a
restricted subset of Python itself (PyPy).
 
C

Chris Rebert

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.'/sw/lib/python2.6/pickle.pyc'

Cheers,
Chris
 
D

Daniel Molina Wegener

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.

If you are looking for a C implementation of DOM as Python Extension,
you can try the lxml extension, which uses the LibXML2 bindings:

http://codespeak.net/lxml/

Best regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,167
Messages
2,570,913
Members
47,454
Latest member
eibaloja

Latest Threads

Top