What are C files doing in the distribution?

Asked by Ram Rachum

What are C files doing in the distribution? Dulwich is advertised as pure-Python, no?

Question information

Language:
English Edit question
Status:
Answered
For:
Dulwich Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jörg W Mittag (joergwmittag) said :
#1

Just a guess: I believe they are alternative implementations of the corresponding Python files. In other words: if you install Dulwich on CPython and on a machine which has a C compiler, then it will use the C implementations, but if you install it on a machine without a C compiler, or on Jython or IronPython or in environments where C extensions are illegal (such as Google App Engine, for example), then it will use the Python files.

Revision history for this message
Mkeeler (mjkeeler7) said :
#2

Ubuntu 10.04 package information for python-dulwich says "All functionality is available in pure python, but for improved performance replacements of some modules written in C are also available. This package include the high performance versions."

So you are correct. You can get by without the C, but it is there to make it faster.

Revision history for this message
Jelmer Vernooij (jelmer) said :
#3

All of Dulwich functionality is available using the pure-Python implementation. Some functions have alternative implementations in C that are quicker than their pure-Python counterparts. These functions are (and will remain) optional but provide better performance.
FAQ #1259: “What are C files doing in the distribution?”.

Can you help with this problem?

Provide an answer of your own, or ask Ram Rachum for more information if necessary.

To post a message you must log in.