title: How to overwrite a imported python class for all calls
body: <p>I create a python-packages /MyLibPackage which I will import in my projects.</p>
  
  <p><code>MyLibPackage.____init____.py</code> includes mymodiciation.py. Furthermore the MyLibPackage Folder contains another file :base_classes.py(=external project)</p>
  
  <p>mymodiciation.py imports "<code>from base_classes import *</code>".</p>
  
  <p>Goal:
  I can import MyLibPackage which has all classes from base_classes (=external project).
  And if I have need to modifiy some classes or functions, I can overwrite this in mymodiciation.py. It works but I got a problem. For example:</p>
  
  <p>I overwrite this classes in mymodiciation.py:</p>
  
  <pre><code>class Bookcollection(Bookcollection):
     new_member = "lalala"
  
  
  class user(user):
     def get_books(self):
        return Bookcollection()
  </code></pre>
  
  <p>if I do:</p>
  
  <pre><code>from MyLibPackage import *
  x = user()
  books = x.get_books()
  </code></pre>
  
  <p>then the object Bookcollection has the property "new_member". Good!
  But if i will do this:</p>
  
  <pre><code>from MyLibPackage import *
  x = shelf() #this class is not overwritten and used also the object "Bookcolelction"
  books = x.get_books()
  </code></pre>
  
  <p>then the object Bookcollection has NOT the property "new_member" because he is instanced with MyLibPackage.base_classes.Bookcollection and not with my overwritten class MyLibPackage.mymodiciation.Bookcollection</p>
  
  <p>How can I say: If I overwrite a class in mymodiciation then MyLibPackage has to use this although when the call cames from MyLibPackage.base_classes.shelf (get_books).</p>