title: Instance variables vs. class variables in Python
body: <p>I have Python classes, of which I need only one instance at runtime, so it would be sufficient to have the attributes only once per class and not per instance. If there would be more than one instance (which won't happen), all instance should have the same configuration. I wonder which of the following options would be better or more "idiomatic" Python.</p>
  
  <p>Class variables:</p>
  
  <pre><code>class MyController(Controller):
  
    path = "something/"
    children = [AController, BController]
  
    def action(self, request):
      pass
  </code></pre>
  
  <p>Instance variables:</p>
  
  <pre><code>class MyController(Controller):
  
    def __init__(self):
      self.path = "something/"
      self.children = [AController, BController]
  
    def action(self, request):
      pass
  </code></pre>