tags:

views:

71

answers:

3

Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?

+4  A: 

Of course using a C library hurts portability. It also prohibites you (in general) to use Jython or IronPython. I would only use a C library if I had no other option. This could happen if direct access to hardware is necessary or if special efficiency requirements apply.

kgiannakakis
+4  A: 

C library is likely to have better performance, but needs to be recompiled for each platform.

You can't use C libraries on Google App Engine

gnibbler
A: 

Portability is one thing. There are even differences between python 2.x and 3.x that can make things difficult with C extensions, if the writer didn't update them.

Another thing is that pure python code gives you a bit more possibilities to read, understand and even modify (although it is usually a bad sign if you need to do that for other peoples modules)

Mattias Nilsson