title: Initialize static class atributes in python
body: <p>I have the following class</p>
  <pre class="lang-py prettyprint-override"><code>class Test:
      x = None  # this is a static variable common to all object created from this class
  
      @classmethod
      def initializeX(cls):
          cls.x = 5
  </code></pre>
  <p>Note that <code>x</code> in practice is an object that needs to be common to all objects created from this class and I can not write e.g <code>x = 5</code> so I need a function to initialize it. So how can I call the function that initializes x only once and not for every object created? Also is it generally good practice in python to skip <code>x = None</code> and define x directly in <code>initializeX(cls)</code>?</p>