title: hasattr() that previously returned "True", returns "False" after code converted into cython
body: <p>I create a simple class in python and check whether it has a certain attribute. After hasattr() Return True I try to rewrite it in Cython and but then hasattr() returns False.</p>
  
  <p>Look at this example in python:</p>
  
  <pre><code>class Foo_p:
      def __init__(self, val):
          self.val = val
      def printVal(self):
          print(self.val)
  
  a=Foo_p(5)
  print(hasattr(a,"val"))
  </code></pre>
  
  <p>this example prints "True".</p>
  
  <p>Now I try to rewrite it in Cython:</p>
  
  <pre><code>%load_ext Cython
  %%cython
  cdef class Foo_c:
      cdef int val
  
      def __init__(self, int val):
          self.val = val
      def printVal(self):
          print(self.val)
  
  b=Foo_c(5)
  print(hasattr(b,"val"))
  </code></pre>
  
  <p>and now it prints "False"</p>
  
  <p>Does anyone has an idea of what has happend?</p>