Extending Python on Win32 - incompatible types warning

Fredrik Lundh effbot at telia.com
Tue Sep 19 01:03:49 CEST 2000


bhellao at my-deja.com wrote:
> I am trying to compile the following C code on Win32. Although the code
> seems to work fine when I call it in Python, for the function call
>    "df += PyFloat_AsDouble(f)"
> the compiler generates the following warning:
> 
> : warning C4133: 'function' : incompatible types - from 'struct
> PyFloatObject *' to 'struct _object *'
> 
> I would appreciate any help.

reading the fine manual might help:
http://www.python.org/doc/current/api/floatObjects.html

    double PyFloat_AsDouble (PyObject *pyfloat) 
    Returns a C double representation of the contents of pyfloat. 

(PyFloat_AsDouble takes a PyObject pointer)

</F>



More information about the Python-list mailing list