import sys from OpenGL.GL import glInterleavedArrays, glVertexPointer, GL_V3F, GL_FLOAT from OpenGL.Tk import _default_root, Opengl def main(): o = Opengl(_default_root, width=600, height=400, indirect=1) as = '' r0 = sys.getrefcount(as) print "initial refcount", r0 for i in range(1000): glInterleavedArrays(GL_V3F, 0, as) r1 = sys.getrefcount(as) print "final refcount", r1 print "delta", r1-r0 print r0 = sys.getrefcount(as) print "initial refcount", r0 for i in range(1000): glVertexPointer(3, GL_FLOAT, 0, as) r1 = sys.getrefcount(as) print "final refcount", r1 print "delta", r1-r0 main()