Tom Ritchford
Feb 10, 2021

--

JSON's no good for debugging purposes. Unless you're 100% sure that the thing you're logging is some combination of lists, strings, numbers, bools, None or dicts, it might raise an exception.

pprint is perfect for debugging any structure in some sort of readable way.

I don't use it even once a month, but that's why this is "lesser known".

--

--

Responses (2)