title: Caching class attributes in Python
body: <p>I'm writing a class in python and I have an attribute that will take a relatively long time to compute, so <strong>I only want to do it once</strong>.  Also, it will not be needed by every instance of the class, so <strong>I don't want to do it by default</strong> in <code>__init__</code>.  </p>
  
  <p>I'm new to Python, but not to programming.  I can come up with a way to do this pretty easily, but I've found over and over again that the 'Pythonic' way of doing something is often much simpler than what I come up with using my experience in other languages.</p>
  
  <p>Is there a 'right' way to do this in Python?</p>