title: Python Language Nuances
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1011431/common-pitfalls-in-python">Common Pitfalls in Python</a>  </p>
  </blockquote>
  
  
  
  <p>I'm learning Python and I come from a diverse background of programming languages. In the last five years, I've written quite a bit of Java, C++, VB.Net, and PHP. As many of you might agree, once you learn one programming language, learning another is just a mater of learning the differences in syntax and best practices.</p>
  
  <p>Coming down from PHP, I've become very accustomed to a lot of script-style language features. For instance, stuff like this tickles me insides:</p>
  
  <pre><code># Retrieve the value from the cache; otherwise redownload.
  if(!($value = $cache-&gt;get($key)))
      # Redownload the value and store in the cache.
      $cache-&gt;set($key, $value = redownload($key));
  </code></pre>
  
  <p>Python, though, doesn't consider assignment to be an expression. OTOH, it does support nice things like the <code>in</code> construct, which I find to be one of the greatest inventions of all time. <code>x in y</code> is so much nicer than <code>!empty($y[$x])</code>.</p>
  
  <p>What other nuances, "missing" features, and performance bottlenecks should I watch out for? I'm hoping to make as seamless a transition into Python development as possible, and hope to learn some of the secrets that will help to smooth out development time and eliminate trial and error. Your insight is appreciated!</p>