Another C API Question

beginner zyzhu2000 at gmail.com
Thu Jul 26 21:06:23 EDT 2007


Hi,

I run into another C API question. What is the simplest way to convert
an PyObject into a double?

For example, I have

 PyObject *obj;

I know obj is a number, but I do not know the exact type. How can I
convert it to double without writing a giant switch() that exhausts
every single type of number?

Thanks,
beginner




More information about the Python-list mailing list