title: Defining @property
body: <p>I have problem in defining a getter by using <code>@property</code> in concrete class. Here is the python code:</p>
  
  <pre><code>from abc import ABCMeta, abstractproperty
  
  class abstract(object):
      __metaclass__ = ABCMeta
  
      def __init__(self, value1):
          self.v1 = value1
  
      @abstractproperty
      def v1(self):
          pass
  
  class concrete(abstract):
      def __init__(self, value1):
          super(concrete, self).__init__(value1)
  
      @property
      def v1(self):
          return self.v1
  </code></pre>
  
  <p>Then test the code and get this error:</p>
  
  <pre><code>test_concrete = concrete("test1")
  test_concrete.v1
  
  ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-190-eb896d7ec1c9&gt; in &lt;module&gt;()
  ----&gt; 1 test_concrete = concrete("test1")
        2 test_concrete.v1
  
  &lt;ipython-input-189-bf15021022d3&gt; in __init__(self, value1)
       11 class concrete(abstract):
       12     def __init__(self, value1):
  ---&gt; 13         super(concrete, self).__init__(value1)
       14 
       15     @property
  
  &lt;ipython-input-189-bf15021022d3&gt; in __init__(self, value1)
        3 
        4     def __init__(self, value1):
  ----&gt; 5         self.v1 = value1
        6 
        7     @abstractproperty
  
  AttributeError: can't set attribute
  </code></pre>
  
  <p>Basically I intend to set <code>v1</code> as a read-only attribute.</p>
  
  <p>I am used to using the same name for the attribute and its getter function, but it seems that I cannot do it if the class inherited from an abstract class.</p>
  
  <p>I found a workaround by using different name for the getter function <code>v1</code> as <code>get_v1</code>:</p>
  
  <pre><code>class abstract(object):
      __metaclass__ = ABCMeta
  
      def __init__(self, value1):
          self.v1 = value1
  
      @abstractproperty
      def get_v1(self):
          pass
  
  class concrete(abstract):
      def __init__(self, value1):
          super(concrete, self).__init__(value1)
  
      @property
      def get_v1(self):
          return self.v1
  </code></pre>
  
  <p>Is there a better workaround for this problem?</p>