Menu

#255 Enumerants not visible to PyLint, PyCharm, static analysis

open
nobody
None
5
2012-11-16
2012-11-16
No

In the file OpenGL/raw/GL/VERSION/GL_1_1.py and others, the OpenGL constants are defined using a long constant string and an "unpack_constants" function that inserts them into the module namespace. This technique makes the constants completely invisible to static analysis tools such as PyLint and PyCharm's Inspection feature. This means I have dozens of red underlines all over any code that uses OpenGL, and I can't autocomplete any GL constants either.

It looks like unpack_constants is only used to evaluate the results of get_gl_extensions and that script could probably be changed to just output e.g. GL_BYTE = Constant(0x1400). (Wasn't it like this for earlier versions of PyOpenGL? Sorry, I'm not good enough at bzr to know how to show a file's history.) I'm interested in getting this changed and I am willing to make whatever changes are needed.

Discussion


Log in to post a comment.