title: Python AttributeError: module has no attribute
body: <p>I have a python module file which has a bunch of class definition along with its method sample.py</p>
  
  <pre><code>def abc():
      ...
  class Sampler(object):
      def foo(self):
         ...
  class Sampler2(object):
       def bar(self):
           ...
  </code></pre>
  
  <p>Now I want to import this file into another python file and use type annotations while defining a function like below: say samplers.py</p>
  
  <pre><code>import sample
   class Xyz(object):
        def foobar(self, sampleparam:sample.Sampler)-&gt; int :
              ...
  </code></pre>
  
  <p>The above is throwing AttributeError: module 'sample' has no attribute 'Sampler'. Is the above implementation incorrect ?</p>