title: How do I get Pylance's type checking to work with this Pydantic example?
body: <p>I'm discovering Pydantic and I see this in an example (<a href="https://pydantic-docs.helpmanual.io/usage/models/#recursive-models" rel="nofollow noreferrer">https://pydantic-docs.helpmanual.io/usage/models/#recursive-models</a>):</p>
  <pre class="lang-py prettyprint-override"><code>from pydantic import BaseModel
  
  class Foo(BaseModel):
      count: int
      size: float = None
  </code></pre>
  <p>I'm using VS Code and Pylance, and until now, I had been ignoring Pylance's type checking functionality because I have multiple instances where I need to be able to set None as the default to a field that doesn't have None in its type annotation.</p>
  <p>I see this in Pydantic, and Pydantic works fine with Pylance, but as is with all the other times I've tried to set a default of None to a field not annotated with None, Pylance flags it with a <code>Expression of type &quot;None&quot; cannot be assigned to declared type</code> problem.</p>
  <p>I figure that if it's meant to work in Pydantic, and it doesn't for me, there has to be something I'm missing.</p>
  <p>I've set up VS Code as per <a href="https://pydantic-docs.helpmanual.io/visual_studio_code/" rel="nofollow noreferrer">https://pydantic-docs.helpmanual.io/visual_studio_code/</a> and it still seems to not work.</p>