Not published yet
The Bug on the Line You Never Ran
Your test passed and the program still crashed on ‘NoneType’. A type checker reads every branch — including the one no test visited — without running your code.
Your test was green and the program still died with ‘AttributeError: NoneType object has no attribute’. The test wasn’t lying — it only spoke about the inputs you gave it. This points a type checker (ty, from the makers of uv) at ten lines of ordinary Python and, without running a line, it finds the crash on the branch your test never walked. Along the way: what None really is, what a type hint actually buys, the one-line ‘narrowing’ fix — and the surprise that plain mypy walks straight past a function wearing no hints. Run on ty 0.0.99, mypy 2.3.1 and Pyright 1.1.414.