Specify context of imported method
<p>I have two files. In the first there is a dictionary ready for export:</p>

<pre><code>__all__ = ['container']

def show_name(self):
   myFunction()
   print self.name

container = {
   'show_name': show_name
}
</code></pre>

<p>In the second file I import <code>myFunction</code> and I define the class <code>Person</code>:</p>

<pre><code>from myModule import myFunction

class Person:
   def __init__(self):
      self.name = 'Bob'
      self.show_name = types.MethodType(container['show_name'], self)

person = Person()
</code></pre>

<p>The problem is that when I call <code>person.show_name()</code> I get the error:</p>

<blockquote>
  <p>NameError: global name 'myFunction' is not defined</p>
</blockquote>

<p>How can I have <code>Person.show_name</code> access the same functions <code>Person</code> does? </p>
