sethserver.com

All Posts

Python

Fix "Object of type X is not JSON serializable" in Python

Updated: June 29, 2026

That "Decimal is not JSON serializable" crash isn't random. JSON only supports a tiny set of types, and Python refuses to guess conversions that can quietly corrupt data (hello, billing). The fix isn't `default=str`. It's picking explicit encoding rules once-Decimal to string, datetime to ISO-8601, UUID to string, Enum to `.value`, dataclasses to `asdict()`-and using them everywhere with `json.dumps(..., default=...)`. read on »

Python

Python Slice Notation: A Complete Guide to start:stop:step Syntax

Updated: April 15, 2026

I kept re-learning Python slices because my brain refused to accept "stop is exclusive." Then I started doing LLM work and suddenly slices were everywhere: token windows, chunking, sliding overlap, all of it. This post nails the only three rules you need (`start:stop:step`), the five slice patterns I actually use, and why "exclusive stop" is the reason chunking doesn’t turn into off-by-one misery. read on »

Newsletter

One email, once a week.

Notes on databases, systems, and the occasional strong opinion about Python. No spam, unsubscribe anytime.