Misspelling Variable Names. Best ways to avoid this sort of error?
<p>Coming from a background of compiled languages without dynamic typing, something I find frustrating in Python is the potential for inadvertently introducing a new variable name via misspelling.</p>

<p>I had an example of this a few days ago where the code went something like this:</p>

<pre><code>received = False

while not received:
   ...
   ...
   ...
   recieved = (some_conditional_statments)
   ...
   ...

print some_results
</code></pre>

<p>Here <em>received</em> was a boolean variable that was supposed to be set to true upon the terminating condition of the loop being reached. Obviously though, in this case it got stuck in an infinite loop due to the misspelt variable (rec*<em>ie</em>*ved)</p>

<p>Obviously a compiler will pick up mistakes like this straight away, I just wondering what techniques people use to help avoid errors like this in Python?</p>
