title: type hint returns NameError: name 'datetime' not defined
body: <p>I have this function below;</p>
  
  <pre><code>def time_in_range(start, end, x):
      """Return true if x is in the range [start, end]"""
      if start &lt;= end:
          return start &lt;= x &lt;= end
      else:
          return start &lt;= x or x &lt;= end
  </code></pre>
  
  <p>The function parameters are all datetime type. I want to add typing hint to the function. This is what I did;</p>
  
  <pre><code>def time_in_range(start: datetime, end: datetime, x: datetime) -&gt; bool:
      """Return true if x is in the range [start, end]"""
      if start &lt;= end:
          return start &lt;= x &lt;= end
      else:
          return start &lt;= x or x &lt;= end
  </code></pre>
  
  <p>I get the error <code>NameError: name 'datetime' is not defined</code>. What is the proper way to add typing for this function?</p>
  
  <p>I am using python v3.7</p>