[Pyrex] 'Using cimport to resolve naming conflicts' doesn't work
Jiba
jiba at tuxfamily.org
Sun Jan 25 16:48:45 CET 2004
Hi,
using cimport to resolve naming conflicts (as explained in the Pyrex
documentation) doesn't work for me, working on openGL function.
With the folowing code :
cimport opengl
opengl.glColor4f(0.0, 0.0, 0.0, 0.0)
def glColor4f(float r, float g, float b, float a):
opengl.glColor4f(r, g, b, a)
def glColor4f2(float r, float g, float b, float a):
global opengl # Needed ?
opengl.glColor4f(r, g, b, a)
the first call to opengl.glColor4f is right, the second one is wrong
(Pyrex generates C code that searches an opengl Python module and then
gets a glColor4f attribute). The third one is right ; adding "global
opengl" seems to fix the bug.
Jiba
More information about the Pyrex
mailing list