Articles
In addition to the advice in the book, this section of the website contains some additional helpful hints. These will generally be expansions on things in the book with a specific viewpoint in mind. If you find these useful and haven't yet taken a look at the book, I'd (humbly) suggest that you do so. If you like these, you'll like the book.
-
2021-02-13
Python's new assignment operator
Python's new pattern matching syntax includes an assignment operator that works backwards — the only place in Python where a=b assigns the value of a to b, not b to a.
-
2020-12-26
Collating Energy Usage Data
I had a SMETSv2 Smart Meter installed with Octopus Energy as my electricity supplier. As they provide an API for usage data, I decided to add a new sensor type to gather import data too.
-
2020-07-10
Rewriting git history to remove type hints
This week I wrote some tools to help me remove type hints from my code samples, so I could offer readers of the book a way to see the code without hints, if that's something they feel strongly about.
-
2020-07-06
Finding test isolation issues with PyTest
It's really frustrating when tests pass for you and not for someone else. This is often due to isolation issues, which can be difficult to debug. This is the approach I take.
-
2020-07-03
Running a subset of tests with PyTest
A good test suite is a fast test suite. If you can't make the tests faster, you can run fewer at a time to make it feel more responsive.
-
2020-05-24
Setting up the Enviro+ Pi HAT's libraries
I wanted to add support for the sensors on this board. This is the first step, using Jupyter notebooks and a remote kernel setup to try sample code.