title: How can mypy accept pydantic's constr() types?
body: <p>I have this code:</p>
  <pre class="lang-py prettyprint-override"><code>from pydantic import BaseModel, constr
  
  DeptNumber = constr(min_length=6, max_length=6)
  
  class MyStuff(BaseModel):
      dept: DeptNumber
  
  ms = MyStuff(dept = &quot;123456&quot;)
  </code></pre>
  <blockquote>
  <p>deptnr.py:6: error: Variable &quot;deptnr.DeptNumber&quot; is not valid as a type<br/>
  deptnr.py:6: note: See <a href="https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases" rel="noreferrer">https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases</a></p>
  </blockquote>
  <p>The provided link doesn't seem to really address my problem (I'm not using <code>Type</code>).</p>
  <p>This happens with or without this <code>mypy.ini</code>:</p>
  <pre><code>[mypy]
  plugins = pydantic.mypy
  
  [pydantic-mypy]
  init_typed = true
  </code></pre>
  <p>Initially I also had that error in a Pydantic <code>choice</code> as below, but I got around that by using Python's <code>Literal</code> instead.</p>
  <pre><code>DIR = choice([&quot;North&quot;, &quot;East&quot;, &quot;South&quot;, &quot;West&quot;])
  </code></pre>
  <p>What do I need to change to make mypy happy with my Pydantic <code>constr</code>?</p>