Advice on Python C modules

Torsten Marek shlomme at gmx.net
Wed Dec 3 11:21:49 EST 2003


Mike Rovner schrieb:
> Torsten Marek wrote:
> 
>>I think about rewriting one C++ library with Python wrappers (by sip)
>>  to a pure Python module (because I just use it from Python).
>>
>>I have to create custom types and inherit from those custom types.
>>Is it better to use pure C for that module, Pyrex or should I stay
>>with my current library (which has to be modified for some other
>>reasons, too)?
> 
> 
> It seems to me that you contradict yourself here.
> Pure python is pure python without any c, c++, pyrex, sip, etc.
> OTOH, if you still need compiled extension for some reason
> (usualy only two excuses are good enough- speed and low-level
> interface to something as hardware or 3rd party libraries)
> why throw out good working code? It's not a good practice.
> 
> So if you don't *have to* use compiled extension you can ask how to achieve
> desired results in pure python.
> 
You're right, sorry. What I meant was compiled extension, because I need 
access to 3rd party libs and I do not want to use their Python bindings 
for speed reasons.

Torsten





More information about the Python-list mailing list