title: TypeError: 'NoneType' object has no attribute '__getitem__'
body: <p>Hi So I created this function called runloopg(x,y,z) that produces a list but I can't call an item on the list:</p>
  
  <pre><code>p=runloopg(10,0.1,6)
  &lt;generator object rtpairs at 0x000000000BAF1F78&gt;
  [(0,0,0,0,0,1), (0.01,0,0,0,0,1), (0.0062349,0.00781831,0,0,0,1), (-0.00222521,0.00974928,0,0,0,1), (-0.00900969,0.00433884,0,0,0,1), (0.0549583,-0.0712712,0,0,0,1), (0.0627244,-0.0645419,0,0,0,1), (0.0696727,-0.0569711,0,0,0,1), (0.0757128,-0.0486577,0,0,0,1), (0.0807659,-0.0397099,0,0,0,1), (0.084766,-0.0302444,0,0,0,1), (0.0876611,-0.0203847,0,0,0,1), (0.0894134,-0.0102592,0,0,0,1)]
  </code></pre>
  
  <p>However when I call an item on my list as so:</p>
  
  <pre><code>p[0]
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-240-a69904524460&gt; in &lt;module&gt;()
  ----&gt; 1 p[0]
  
  TypeError: 'NoneType' object has no attribute '__getitem__'
  </code></pre>
  
  <p>This is the code for runloopg:</p>
  
  <pre><code>import numpy
  import raytracer29
  
  def rtpairs(R, N):
      for i in range(len(R)):
          r=R[i]
          n=N[i]
          for j in range(n):
              t = j*2*numpy.pi/n
              yield r,t
  
  def rtuniform(n, rmax, m):
      R=numpy.arange(0,rmax,rmax/n)
      N=numpy.arange(1, n*m, m)
      return rtpairs(R, N)
  
  def runloopg(n, rmax, m):
      #print  rtuniform(n, rmax, m)
      bund = []
      for r,t in rtuniform(n, rmax, m):
          myRay = raytracer29.Ray(r * numpy.cos(t), r * numpy.sin(t),0,0,0,1)        
          bund.append(myRay)
      return bund
  </code></pre>