Another C API Question

beginner zyzhu2000 at
Fri Jul 27 03:06:23 CEST 2007


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?


More information about the Python-list mailing list