title: How do Python properties work?
body: <p>I've been successfully using Python properties, but I don't see how they could work. If I dereference a property outside of a class, I just get an object of type <code>property</code>:</p>
  
  <pre><code>@property
  def hello(): return "Hello, world!"
  
  hello  # &lt;property object at 0x9870a8&gt;
  </code></pre>
  
  <p>But if I put a property in a class, the behavior is very different:</p>
  
  <pre><code>class Foo(object):
     @property
     def hello(self): return "Hello, world!"
  
  Foo().hello # 'Hello, world!'
  </code></pre>
  
  <p>I've noticed that unbound <code>Foo.hello</code> is still the <code>property</code> object, so class instantiation must be doing the magic, but what magic is that?</p>