Things that might not be obvious when writing Python and other oddities.
unintuitive_python.ipynb is committed with its
outputs, so GitHub renders every result inline and you can just read it.
uv is the only prerequisite. It fetches the pinned
interpreter and installs the kernel from uv.lock, so everyone gets the same
environment.
uv syncThat creates .venv on Python 3.11 with a Jupyter kernel in it. Point your
editor at .venv and open the notebook, or bring your own frontend:
uv run --with jupyterlab jupyter labUse uv run --with, not uvx. uvx would build an isolated environment on
whatever Python it likes.
Run the cells top to bottom.
The annotation example relies on annotations being evaluated when the def
runs. PEP 649 made them lazy in 3.14, and
walrus in an annotation is now a SyntaxError.