Francesco Pierfederici (Python Inside)
PEP 484 (building upon PEP 3107) introduced support for type hints. Type hints allow, among other things, third-party tools to check Python code for possible bugs due to unintentional type mismatches. They also serve as documentation for your functions and methods.
Understandably - or maybe surprisingly - there has been a growing interest in type hints within the Python community, especially in the last few year; even though, outside large code bases, type hints are still not that widely used.
At the same time and for many years, as Python programmers, we are used to "duct typing": focusing more on object functionality and interfaces than on their types.
Are these two approaches completely at odds with each other?
This extremely practical tutorial will teach you what type hints are and how you use them in your own code. We will focus on realistic examples and see how type hints can co-exist with Python dynamism and duck-typing. We will explore the ways in which type hints can make your code better and in some cases faster.
We will use Python 3.8 and strongly recommend that attendees install a reasonably recent version of Python 3 to make the most out of the training.
Source code available on GitHub