title: Setting _fields_ dynamically in ctypes.Structure
body: <p>Reading the documentation <a href="https://docs.python.org/2/library/ctypes.html" rel="nofollow">here</a>, I see that you can use ctypes.Structure as follows :-</p>
  
  <pre><code>&gt;&gt;&gt; class Int(Structure):
  ...     _fields_ = [("first_16", c_int, 16),
  ...                 ("second_16", c_int, 16)]
  ...
  &gt;&gt;&gt; print Int
  </code></pre>
  
  <p>Would it be possible for me to create such a class by using a list that I decide upon dynamically? For eg, something along the lines of :-</p>
  
  <pre><code>def int_factory(fields):
      int_class = get_int_class(fields) # This returns a class object with _fields_ set to fields
      return int_class
  
  def user(values=[1,2]):
      int_class = int_factory(int_fields)
      i = int_class(values[0], values[1])
  </code></pre>
  
  <p>Would it be possible to do this?</p>