How to avoid a recursive loop with __setattr__ and a property settter?
<p>This causes an infinite recursive loop when setattr is called, when trying to set the value for some_prop, which is a property with a setter:</p>

<pre><code>class TypeSystem(object):

    def __setattr__(self, key, value):
        if the_special_case is True:
            # do something
        else:
            super(TypeSystem,self).__setattr__(key,value)


class Entity(TypeSystem):

    @property
    def some_prop(self):
        some_prop = self.data.get('some_prop')
        if some_prop is None and hasattr(self,"some_prop"):
            some_prop = self.some_prop
        return some_prop

    @some_prop.setter
    def some_prop(self,value):
        self.some_prop = value

&gt;&gt;&gt; entity = Entity()
&gt;&gt;&gt; entity.some_prop = 3
</code></pre>

<p>This works fine for normal attributes that aren't defined as properties because Super calls object's setattr to prevent the recursive loop. </p>

<p>But because some_prop isn't pre-defined, it looks like setattr is being invoked instead some_prop's setter so it gets pulled into a loop.</p>

<p>I have tried this as well....</p>

<pre><code>@some_prop.setter
def some_prop(self, value):
    super(TypeSystem, self).__setattr__("some_prop", value)
</code></pre>

<p>But it still goes into a recursive loop. I'm not seeing how to avoid it.</p>
