: and the
= is a type hint, so
primes is indeed defined as
List[int], and initially set to an empty list (and
stats is an empty dictionary initially, defined as
Dict[str, int] are not part of the next syntax however, these were already defined in the Python 3.5 typing hints PEP. The 3.6 PEP 526 – Syntax for Variable Annotationsproposal only defines the syntax to attach the same hints to variables; before you could only attach type hints to variables with comments (e.g.
primes =  # List[int]).
Dict are Generic types, indicating that you have a list or dictionary mapping with specific (concrete) contents.
List, there is only one ‘argument’ (the elements in the
[...] syntax), the type of every element in the list. For
Dict, the first argument is the key type, and the second the value type. So all values in the
primes list are integers, and all key-value pairs in the
stats dictionary are
(str, int) pairs, mapping strings to integers.
Like type hints on functions, their use is optional and are also considered annotations(provided there is an object to attach these to, so globals in modules and attributes on classes, but not locals in functions) which you could introspect via the
__annotations__ attribute. You can attach arbitrary info to these annotations, you are not strictly limited to type hint information.
You may want to read the full proposal; it contains some additional functionality above and beyond the new syntax; it specifies when such annotations are evaluated, how to introspect them and how to declare something as a class attribute vs. instance attribute, for example.