title: How to implement an optional property?
body: <p>I want to set up a property only if requested explicitly. As this property will involve extra computation time, I want it initialized with <code>None</code> and only initializing if a calling function requests to do so. </p>
  
  <p>For example:</p>
  
  <pre><code>class File:
      def __init__(self, filename, content):
           self.filename = filename
           self.content = content
           self.hash = None or self.get_hash()
  
      def get_hash():
            '''do some hashing there'''
  </code></pre>
  
  <p>I have seen some property of that kind but don't know how this could work trigger the function by calling:</p>
  
  <pre><code>my_file = File('text.txt', 'Hello there')
  my_file.hash 
  </code></pre>