title: Python Child cannot use a Module the Parent Imported
body: <p>I have a funny import error when using Inheritence in Python.</p>
  
  <p>In a parent class I import the module sqlite3, in a child class I then try to use a sqlite3 function but I get an error saying "NameError: global name 'sqlite3' is not defined". <strong>Why does this happen &amp; how do I fix it?</strong></p>
  
  <p>The 2 classes are in separate files:</p>
  
  <p>Parent.py  </p>
  
  <pre><code>import sqlite3
  
  class Parent:
      def __init__(self):
  
          self.create_database()
  
      def create_database(self):
          """ Virtual function to be overriden in child classes """
          pass
  
      ...more class functions that use sqlite3 functions
  </code></pre>
  
  <p>Child.py  </p>
  
  <pre><code>import Parent
  
  class Child( Parent.Parent ):
      def create_database(self):
          self.db = sqlite3.connect("test.db") # Error occurs HERE
  
  c = Child()
  </code></pre>