Defining a function multiple times
<p>I've got a dynamic Python service that will be defining functions on a per-record basis and I ran into something I couldn't quite figure out.  Say I've got a test program set up like so: </p>

<pre><code>func_str = """
def func():
  print "top"
"""
exec func_str

func_str = """
def func():
  print "bottom"
"""
exec func_str

func()
</code></pre>

<p>This will, of course, print <code>"bottom"</code>, as the second call to <code>exec func_str</code> overwrites the first.  I'm curious what happens under the hood.  Is the first function definition deleted in some way?</p>
