Our next session will take place on 8th November 2023. This is a physical even with the option to attend virtually. Please note our policy on reducing the spread of infectious diseases such as Covid-19.
The format is (roughly)
- 18:00 Pizza for those who are joining us in person
- 18:30 Talk - details below
- 19:15 A practical challenge
- 20:30 Project round-ups
Gradual Static Typing in Python
Python is a dynamically typed language which programmers love as it lets them easily and quickly write code without worrying too much about types. However, it can sometimes cause problems for readability and maintainability in larger code bases even with the help of a smart IDE. Should we abandon Python and switch to a statically typed language?
Did you know that Python has support for type hinting? This allows programmers to add gradual static typing for static analysis tools like mypy and your IDE’s built-in linter. This has been used by large companies like Dropbox and Instagram to improve the way they write Python. This way you can selectively add typing information to just some parts of your code base at a time and more easily detect and fix bugs! In this talk, you will learn the basics of how to add static typing hints to your Python code. We will show how to type hint functions, variables, collections, and use unions and optionals.
Biography
Dr Lee A. Christie is a Research Fellow working at Robert Gordon University’s National Subsea Centre where he regularly uses Python in real world applications such as ferry planning and energy network design. He also teaches an introductory Python module for MSc. Business Analytics. He has been programming since about 1997 and picked up Python in 2013.
Challenge
The talk will be followed by a challenge which attendees can work on in small groups or solo.
So, if you can, bring a laptop or other device that you can run Python on. If you don’t already have Python set up, we can help you with that too. Coding in pairs or small groups (especially mixing beginner and more experiences coders) is strongly encouraged, though you can also code solo.
Registration
Register for the meeting.
Keep in touch
We recommend joining our Slack group. There you can join the #APUG channel and stay in touch with other attendees, and presenters, suggest talks, and ask questions.
If you are a beginner looking to get started in Python have a look at our Learning Resources page where we recommend a free video course on Youtube.