title: python factory functions compared to class
body: <p>Simple example of a nested function:</p>
  <pre><code>def maker(N):
      def action(X):
          return X * N
      return action
  </code></pre>
  <p>Do factory functions have advantages over creating a class? Performance, memory, clean up?</p>