How To Limit Properties Available On a Python Class
<p>Take the following class</p>

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

def __init__(self, first_name, last_name):
    self.first_name = first_name
    self.last_name = last_name
</code></pre>

<p><em>How can I prevent the following usage?</em></p>

<pre><code>p1 = Person('Foo', 'Bar')
p1.firstname='Fooooooo'
</code></pre>

<p>The code above will execute successfully in Python, however, a mistake was made with the name of the property, i.e. its missing <code>_</code> between <code>first</code> and <code>name</code></p>

<p><strong>UPDATE: This sounds like "Monkey Patching", why do I want to do this?</strong></p>

<p>My intention is to simply help avoid the user from setting the wrong property, have the code execute, and see unexpected behavior and not be aware of the mistake immediately.</p>

<p>What does the Pythonic way recommend here? </p>
