Overview
Syllabus
Intro
What are Function Annotations? Syntactic sugar for adding metadata to function definitions
Annotations are just syntactic sugar
Adding Typing Information
Helping tools (IDE, Editor)
Wait a sec!
Libraries usually do this
Experiment: Runtime checking
Runtime checking: how it looks
But isinstance is killing duck typing!
Another example
Implementation of structural interfaces
Types + behaviour = predicates
More fun with predicates
The open function annotated again
Unions
Function overloading
More kinds of types typedefs
A different approach to type annotations: rightarrow
Using rightarrow
Combining different uses of annotations
Annotations for language bridges
Why annotations are not used? • Not a wide know feature
Questions?
Taught by
EuroPython Conference