title: What's the difference between namedtuple and NamedTuple?
body: <p>The <a href="https://docs.python.org/3/library/typing.html#typing.NamedTuple" rel="noreferrer"><code>typing</code> module documentation</a> says that the two code snippets below are equivalent.</p>
  
  <pre class="lang-py prettyprint-override"><code>from typing import NamedTuple
  
  class Employee(NamedTuple):
      name: str
      id: int
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-py prettyprint-override"><code>from collections import namedtuple
  
  Employee = namedtuple('Employee', ['name', 'id'])
  </code></pre>
  
  <p>Are they the exact same thing or, if not, what are the differences between the two implementations?</p>