title: What's the best approach to defer class attribute initialization?
body: <p>I have the following OO use-case:</p>
  
  <pre><code>class SomeClass(object):
  
      def __init__(self, arg1):
          self.attr_now = arg1
          self.attr_later = None
  
      def compute(self):
          # do some lengthy computation ...
          self.attr_later = x # some result
          # continue work ... 
  </code></pre>
  
  <p>Is this an ideal approach to defer initialization of attribute <code>attr_later</code> or is there a better way? What I see is the type unsafety of the <code>attr_later</code> as it may change type during the lifespan of the enclosing instance ...</p>