Advice on Python C modules

T

Torsten Marek

Hello all,

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)?

thanks for your time

greets

Torsten
 
M

Mike Rovner

Torsten said:
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.

Mike
 
T

Torsten Marek

Mike said:
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
 

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

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,933
Members
47,472
Latest member
blackwatermelon

Latest Threads

Top