We encourage contributing pxds for widespread libraries to the Cython
distribution (in the Cython/Includes folder, available in the default
Cython search path). OpenGL pxds would certainly be accepted; just provide
the files.
>
> I have an opengl.pxi with the whole API declared, and an empty
> opengl.pxd that just includes this. As we cannot "from opengl comport
> *", OpenGL code looks strange with a cimport, so it is better to just
> directly include a pxi.
I think this is no longer true in Cython, you can do "from opengl cimport
*" in 0.11.x at least.
Dag Sverre
Perhaps it would be a good idea to have the stuff in gl.h, glu.h, etc
live in separate files gl.pxd, glu.pxd ... and have a opengl.pxd taht
cimport * them all ?
>
> We encourage contributing pxds for widespread libraries to the Cython
> distribution (in the Cython/Includes folder, available in the default
> Cython search path). OpenGL pxds would certainly be accepted; just provide
> the files.
>
Of course.
>>
>> I have an opengl.pxi with the whole API declared, and an empty
>> opengl.pxd that just includes this. As we cannot "from opengl comport
>> *", OpenGL code looks strange with a cimport, so it is better to just
>> directly include a pxi.
>
> I think this is no longer true in Cython, you can do "from opengl cimport
> *" in 0.11.x at least.
>
Definitely yes, try to cythonize the two lines below.
from stdlib cimport *
free(malloc(1024))
> Dag Sverre
>
>
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
+1, we also do that for "python.pxd" and its API subsets in
Cython/Includes/python_*.pxd.
Stefan
Well, the defenders of Python's semantics would say no... But I would
still like to have a way (not on by default) to ask Cython to at least
generate a warnings (but only if the collision have different
types/signatures) ...
On that note, I think it would be better to have an hierarchy. Using
Python as an example, I'd rather have
cimport cpython.exc
cimport cpython.buffer
and so on. (I don't think we should change the way it is for CPython now,
but something to keep in mind for new additions.)
Dag Sverre