June 2017
Beginner to intermediate
274 pages
6h 49m
English
All the annotations are stored in a dictionary called __annotations__, which is an attribute of the function itself:
As we can see in the preceding code example, annotations are not type declarations, though they could certainly be used for that purpose and they resemble the typing syntax used in some other languages, as shown here:

They are arbitrary expressions, which means that arbitrary values can be stored in the __annotations__ dictionary. They don't add any meaning to Python itself, except that it should store ...
Read now
Unlock full access