title: To what degree might this extension type be inefficient due to the use of an object type-declaration?
body: <p>I was told the following extension type <a href="https://stackoverflow.com/questions/41905077/can-a-cdef-class-store-a-variable-that-isn-t-type-declared/41905513#41905513">may not be very efficient</a> due to the need for a Python object type-declaration for the use of <code>DefaultDict</code>. Can someone explain why this is, and whether <code>DefaultDict</code> could still be worth using (as opposed to <code>dict</code>)? </p>
  
  <pre><code>cdef class CythonClass(object):
  
      cdef int var1, var2
      cdef object defaultdict
  
      def __init__(self, a, b):
          self.var1 = a
          self.var2 = b
          self.defaultdict = DefaultDict(DefaultDict([]))
  </code></pre>