How to protect againt typos when setting value for class members?
<p>Consider the following example:</p>

<pre><code>class A():
    def __init__(self):
        self.veryImportantSession = 1

a = A()
a.veryImportantSession = None # ok

# 200 lines below
a.veryImportantSessssionnnn = 2 # I wanna exception here!! It is typo!
</code></pre>

<p>How could I make it so that an exception will be raised if I try to set a member that is not set in <code>__init__</code>?</p>

<p>Code above won't fail when it is executed, but gives me a fun time to debug the problems.</p>

<p>Like with str:</p>

<pre><code>&gt;&gt;&gt; s = "lol"
&gt;&gt;&gt; s.a = 1
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'str' object has no attribute 'a'
</code></pre>

<p>Thanks!</p>
