title: Python: Fixed type argument from a class
body: <p>To fix the type of the argument of a method (function) I can declare a variable like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>def function_name(parameter1: type) -&gt; return_type:
      ...
  
  # for instance
  def function_name(parameter1: int) -&gt; str:
      ...
  # parameter1 must be an integer and returns a string
  </code></pre>
  
  <p>but if I define a class, how can I fix the argument (or the return type) of the function as a variable from a type class. For instance:</p>
  
  <pre class="lang-py prettyprint-override"><code>class MyClass:
      __init__(self):
          ...
  
  def function_name(parameter1: MyClass) -&gt; str:
      ...
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>Undefined name 'MyClass'
  </code></pre>