title: Python - what's the difference between @property and setting in __init__()?
body: <p>Couldn't quite get a straight answer from other threads on this one:</p>
  
  <p>In Python, what's the main difference between using</p>
  
  <pre><code>class Foo(object):
    def __init__(self, x):
      self.x = x
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Foo(object):
    def __init__(self, x):
      self._x = x
  
    @property
    def x(self):
      return self._x
  </code></pre>
  
  <p>By the looks of it using @property in this way makes x read-only.. but maybe someone has a better answer? Thanks /Fred</p>