title: python 3: class "template" (function that returns a parameterized class)
body: <p>I am trying to create a function that is passed a parameter <code>x</code> and returns a new class <code>C</code>. <code>C</code> should be a subclass of a fixed base class <code>A</code>, with only one addition: a certain class attribute is added and is set to equal <code>x</code>.</p>
  
  <p>In other words:</p>
  
  <pre><code>class C(A):
    C.p = x # x is the parameter passed to the factory function
  </code></pre>
  
  <p>Is this easy to do? Are there any issues I should be aware of?</p>