Grant Paton-Simpson

Grant has been an enthusiastic user of Python for many years and has delivered numerous conference talks, meetup presentations, and training sessions on the language. Grant's open source statistics application, SOFA Statistics (over 300,000 downloads to date) is completely written in Python as is the forthcoming replacement SOFA Lite. More recently, Grant has collaborated with Ben Denham to launch the Lean Python (When Of Python) initiative aimed at ensuring Python lives up to its original promise of simplicity and elegance. Grant currently works in the Tech Insights team at 2degrees and was part of the Data Science Team at Qrious where he processed hundreds of billions of records using PySpark and Python.


Sessions

08-23
09:00
60min
Python 4 hour Crash Course - Part 1/2
Grant Paton-Simpson

Learn as much Python as you can in four hours with a mix of theory and practical, hands-on typing of code.

The overall structure of the workshop is: Learning Python (why and how), Main Content (most of the workshop), Revision, Mini Project, Final Questions.

Content covered includes: Syntax, Data types (Numbers, Strings (text), Lists, Dictionaries (mappings), Sets, Others, Dataclasses), Functions, Conditionals, Loops, Comprehensions, Importing, Exceptions (esp. errors), Common mistakes.

Many topics have been left out so we can spend more time on the topics we do cover. At the end of the course you are welcome to keep the detailed slides, including notes, so you can do revision.

For details please see https://kiwipycon.nz/programme/friday-workshops

Breakout Room
08-23
10:20
160min
Python 4 hour Crash Course - Part 2/2
Grant Paton-Simpson

Learn as much Python as you can in four hours with a mix of theory and practical, hands-on typing of code.

The overall structure of the workshop is: Learning Python (why and how), Main Content (most of the workshop), Revision, Mini Project, Final Questions.

Content covered includes: Syntax, Data types (Numbers, Strings (text), Lists, Dictionaries (mappings), Sets, Others, Dataclasses), Functions, Conditionals, Loops, Comprehensions, Importing, Exceptions (esp. errors), Common mistakes.

Many topics have been left out so we can spend more time on the topics we do cover. At the end of the course you are welcome to keep the detailed slides, including notes, so you can do revision.

For details please see https://kiwipycon.nz/programme/friday-workshops

Breakout Room
08-24
10:30
30min
Modern Python - Better Python (the Horrors of My Earlier Code)
Grant Paton-Simpson

Modern Python is better Python. Understanding my older Python code took much more brain power than understanding my newer code. Improvements in readability have been rapid in the last few years as new language features have been harnessed. Before they were incorporated, it often required intense concentration, and the loading of step-by-step details into my memory, to grasp what was happening as information flowed through the code. Using some of the newer Python features has reduced the mental load significantly. The key idea is readability - more of the code has names making it more semantic. It is also more restricted. For example, the inputs and outputs of functions commonly have defined and enforced structures (sometimes using pydantic). All of this makes it easier to work out what code is doing and make changes without getting confused. The main changes are:

1) widespread use of dataclasses (3.6+) as name-rich data structures - especially for function input and output
2) use of type hints (3.5+) as documentation for both input and output
3) use of StrEnum (3.11+) instead of ordinary strings for programmer-defined things
4) using the add_note (3.11+) method on exceptions - adding notes built from f-strings (3.6+) makes it easier to see what is happening when things go wrong.

There has also been a greater emphasis on making the boundaries and interfaces between functions more logical and natural from a human point of view, a change encouraged by the greater use of type hinting and dataclasses. The result is code that is more relaxing to debug, modify, and extend. It is certainly much easier and safer to work on when tired or distracted. Learn how to improve your code using some of the newer features of modern Python.

Pythonista
Breakout Room