title: What are variable annotations?
body: <p>Python 3.6 is about to be released. <a href="https://www.python.org/dev/peps/pep-0494/" rel="noreferrer">PEP 494 -- Python 3.6 Release Schedule</a> mentions the end of December, so I went through <a href="https://docs.python.org/3.6/whatsnew/3.6.html" rel="noreferrer">What's New in Python 3.6</a> to see they mention the <em>variable annotations</em>:</p>
  
  <blockquote>
    <p><a href="https://www.python.org/dev/peps/pep-0484" rel="noreferrer">PEP 484</a> introduced standard for type annotations of function parameters, a.k.a. type hints. This PEP adds syntax to Python for annotating the types of variables including class variables and instance variables:</p>
  
  <pre><code>primes: List[int] = []
  
  captain: str  # Note: no initial value!
  
  class Starship:
       stats: Dict[str, int] = {}
  </code></pre>
    
    <p>Just as for function annotations, the Python interpreter does not attach any particular meaning to variable annotations and only stores them in a special attribute <code>__annotations__</code> of a class or module. In contrast to variable declarations in statically typed languages, the goal of annotation syntax is to provide an easy way to specify structured type metadata for third party tools and libraries via the abstract syntax tree and the <code>__annotations__</code> attribute.</p>
  </blockquote>
  
  <p>So from what I read they are part of the type hints coming from Python 3.5, described in <a href="https://stackoverflow.com/q/32557920/1983854">What are Type hints in Python 3.5</a>.</p>
  
  <p>I follow the <code>captain: str</code> and <code>class Starship</code> example, but not sure about the last one: How does <code>primes: List[int] = []</code> explain? Is it defining an empty list that will just allow integers?</p>