title: isinstance fails for a type imported via package and from the same module directly
body: <pre><code>/Project
  |-- main.py
  |--/lib
  |  |--__init__.py
  |  |--foo.py
  |  |--Types.py
  </code></pre>
  
  <p><code>/Project/lib</code> has been added to the <code>PYTHONPATH</code> variables.</p>
  
  <p><strong>Types.py:</strong></p>
  
  <pre><code>class Custom(object):
      def __init__(self):
          a = 1
          b = 2
  </code></pre>
  
  <p><strong>foo.py:</strong></p>
  
  <pre><code>from Types import Custom
  def foo(o):
      assert isinstance(o, Custom)
  </code></pre>
  
  <p>Finally, from <strong>main.py</strong>:</p>
  
  <pre><code>from lib.Types import Custom
  from lib.foo import foo
  a = Custom()
  foo(a)
  </code></pre>
  
  <p>The problem now is, that <code>a</code> is of type <code>lib.foo.Custom</code>, while the isinstance call will check if it equals <code>foo.Custom</code>, which obviously returns false.</p>
  
  <p>How can I avoid this problem, without having to change anything in the library (lib)?</p>