title: how to create empty c type array (or just one NULL value) in python?
body: <p>I was wondering whether (and how) one can create empty c type arrays in python. The following code works fine if I want to initialize an array with zeros:</p>
  
  <pre><code>from ctypes import *
  data = [0 for i in xrange(10)]
  a = ((c_float *10))(*data)
  </code></pre>
  
  <p>If data is a list of <code>None</code> values however, I get an error message:</p>
  
  <pre><code>data = [None for i in xrange(10)]
  a = ((c_float *10))(*data)
  
  TypeError:  float expected instead of NoneType instance
  </code></pre>
  
  <p>is there a way to initialize and array with NONEs or NULLs?</p>
  
  <p><strong>EDIT 1:</strong>
  the reason why I want an array with None / Null is that I want to upload this array to the GPU. If I initialize my array with Zeros, then zeros will be rendered. However if I initialize it will NULL (as defined in c), nothing is rendered.</p>
  
  <p><strong>EDIT 2:</strong>
  the reason for using <code>c_float</code> is that I need to cast my data to <code>c_float</code> in order for it to be compatible with opengl.</p>
  
  <p><strong>EDIT 3:</strong>
  if <code>data</code> is made of zeros, then the following code will render me a bunch of points @ location 0 / 0. I was hoping that sending <code>NULL</code> values to the GPU will not result in any points being rendered.</p>
  
  <pre><code>glBindBuffer(GL_ARRAY_BUFFER, vbo)    
  glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(data), data)
  glVertexPointer(n_COORDINATES_PER_VERTEX, GL_FLOAT, 0, 0)
  glDrawArrays(GL_LINE_STRIP, 0, len(data))
  </code></pre>
  
  <p><strong>EDIT 4:</strong>
  Another use-case when you might want to use <code>NULL</code> in python: according to the <a href="http://www.opengl.org/wiki/Vertex_Buffer_Object" rel="nofollow">opengl website</a>, the following is how to allocate memory on the GPU:</p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, SizeInBytes, NULL, GL_STATIC_DRAW)
  </code></pre>
  
  <p>If I do this in my python code, I get the following error: <code>NameError: global name 'NULL' is not defined</code></p>
  
  <p>but there must be a way to do this in python, right?</p>