title: cdef statement not allowed here for structure
body: <p>I have a simple Astruct.pyx with a struct definition (Astruct.pxd):</p>
  
  <pre><code>cdef struct A:
      int x
      int y
      int z
  </code></pre>
  
  <p>And a Cython function, that uses it (struct_test.pyx):</p>
  
  <pre><code>from random import randint
  from Astruct cimport A
  
  def do():
      N = 1000000
      M = 65535
      As = []
      total = 0
      for i in xrange(N):
          cdef A a
          a.x = randint(0, M)
          a.y = randint(0, M)
          a.z = randint(0, M)
          As.append(a)
      for i in xrange(N):
          total += As[i].x + As[i].y + As[i].z
      print total
  </code></pre>
  
  <p>However, when I try to build struct_test.pyx, I get this error: "cdef statement not allowed here", pointing at "cdef A a". It does not complain about another definition of A variable if it is outside the loop, but I do not understand what is so special about for loop.</p>