Speaker: Sheena O'Connell
Time: Oct 10 (Wed), 09:00
In this tutorial session we'll briefly cover some of the pros and cons of Python type checking (mostly the pros to be honest) and then get our hands dirty. We'll start off with writing some fresh code and adding Type annotations as we go. We'll then cover a bit of how to add type checking to pre-existing codebases.
Basic knowledge of Python. If you can run your code and you are comfortable with the syntax around variables, functions, classes and loops then you should be quite comfortable. It would also be useful if you know how to drive a virtalenvironment but this is not strictly necessary.
We'll be working in both Python2 and 3. You'll need to bring a laptop with the following things installed:
Most of this tutorial will be in Python3.6+:
- python3 -m pip install mypy
- python3 -m install typingextensions
We will also cover type checking in Python2.7:
- python -m pip install typing
You are welcome to use virtual environments or pipenv.
What we'll cover
- What is type checking and why should we use it?
- Python3 type annotations
- Python2 type annotations
- Adding annotations to existing projects
By the end of this you...
Should be able to consistently write saner, more robust and more explicit code. Which is always a worthwhile goal