title: What is the performance overhead of nested functions?
body: <p>In Python, it is possible to nest functions like this:</p>
  
  <pre><code>def do_something():
      def helper():
          ....
      ....
  </code></pre>
  
  <p>Unless Python handles this case more smartly, <code>helper</code> has to be created anew every time <code>do_something</code> is used. Is there in fact a performance hit from doing this instead of creating the helper function outside of the main one and if yes, how great is it?</p>