Property method in python
<p>Can some1 explain me this behaviour as to why 1) doesnt work while 2) and 3) works
1)</p>

<pre><code>class bm(object):
   ....:     def __init__(self,val):
   ....:         self.a=val
   ....:     def get(self):
   ....:         return self.a
   ....:     def set(self,val):
   ....:         self.a=val
   ....:     a=property(get,set)
   ....:

In [43]: ob1=bm('vin')
</code></pre>

<p>gives me Recursive error
,while the below code works fine
2)</p>

<pre><code>class bm(object):
   ....:     def __init__(self,val):
   ....:         self._a=val
   ....:     def get(self):
   ....:         return self._a
   ....:     def set(self,val):
   ....:         self._a=val
   ....:     a=property(get,set)
   ....:

In [43]: ob1=bm('vin')
</code></pre>

<p>Works fine.I can access ob.a and do ob.a=''</p>

<p>Even this works fine
3)</p>

<pre><code>class bm(object):
   ....:     def __init__(self,val):
   ....:         self.a=val
   ....:     def get(self):
   ....:         return self._a
   ....:     def set(self,val):
   ....:         self._a=val
   ....:     a=property(get,set)
   ....:

In [43]: ob1=bm('vin')
</code></pre>

<p>Works fine.I can access ob.a and do ob.a=''</p>
