wat (via) This is a really neat Python debugging utility. Install with pip install wat-inspector
and then inspect any Python object like this:
from wat import wat
wat / myvariable
The wat / x
syntax is a shortcut for wat(x)
that's quicker to type.
The tool dumps out all sorts of useful introspection about the variable, value, class or package that you pass to it.
There are several variants: wat.all / x
gives you all of them, or you can chain several together like wat.dunder.code / x
.
The documentation also provides a slightly intimidating copy-paste version of the tool which uses exec()
, zlib
and base64
to help you paste the full implementation directly into any Python interactive session without needing to install it first.
Recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024