title: Python: annotation for object types in method
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3247833/how-to-check-arguments-of-the-function">How to check arguments of the function?</a>  </p>
  </blockquote>
  
  
  
  <p>Probably this is duplicated question.. sorry for that..</p>
  
  <p>Let's look at the example below:</p>
  
  <pre class="lang-py prettyprint-override"><code>class ClassA(object):
       pass
  class ClassB(object):
       pass
  
  def foo(a, b):
      if not isinstance(a, ClassA):
           raise ValueError("1st agrument should be instance of ClassA")
      if not isinstance(b, ClassB):
           raise ValueError("2nd agrument should be instance of ClassB")
      print(a)
      print(b)
  </code></pre>
  
  <p>Is there any annotation in 2.7 python or something in <code>__future__</code> module to annotate method to check input variables ? </p>
  
  <p>Writing those <code>if not isinstance</code> makes me really mad :D</p>