title: How to initialise a class variable with __init__()?
body: <p>As I understand, a class property can be used in a sense as the static variable for Python. I have a class and I would like to set this static variable during the first run of <code>__init__()</code>, i.e. when the first object is being created and to keep it like that. Not to update it each time. What should I do exactly? Even setting a flag doesn't help.</p>
  
  <pre><code>class A():
      foo=None
      foo_set_flag=False
      def __init__(self,arg_foo):
          if not self.foo_set_flag:
              self.foo=arg_foo
              foo_set_flag=True
  a=A(12)
  b=A(13)
  print a.foo
  print b.foo
  </code></pre>
  
  <p>which gives:</p>
  
  <pre><code>12
  13
  </code></pre>
  
  <p>and of course I expect </p>
  
  <pre><code>12
  12
  </code></pre>