sethserver.com

Python

Python

OpenAI Bought Astral - and my fav tool uv

Updated: September 17, 2026

OpenAI is buying Astral, the team behind `uv`, Ruff, and `ty`. I love these tools, but I also get that "someone bought the plumbing" anxiety. This post breaks down why `uv` became my default, what acquisitions tend to break in open source, and the specific red flags (logins, telemetry, AI "help," enterprise splits) that would make me bail fast. read on »

Python

Python Pydantic Validation: Stop Writing Manual Checks

Updated: September 17, 2026

Manual input checks start as "just a few if statements" and end as validation logic smeared across your whole codebase. This post shows how Pydantic v2 pulls that mess into one model: typed fields, safe coercion (yes, "42" - 42), clean error messages, and custom rules with @field_validator-so your Flask routes stay thin and your data stays sane. read on »

Python

Python asyncio Recipes

Updated: September 17, 2026

Asyncio gets easier once you stop trying to memorize the event loop and start using a few patterns that work. This post is a copy-paste set of the recipes I actually ship: concurrent URL fetches, timeouts, worker pools with queues, debouncing noisy events, running blocking code with `to_thread()`, and clean shutdown with signals. Each one includes the common mistake that bites people (like per-request `ClientSession`s or forgetting `task_done()`). read on »

Python

Mastering Python's itertools: Efficient Data Processing and Manipulation

Updated: September 17, 2026

itertools is Python's built-in way to write cleaner loops without building huge lists first. This post shows the iterator mindset-stream values, keep pipelines moving-and the handful of tools worth memorizing: cycle/repeat, chain, product, permutations, and combinations. It ends with a practical log-processing pipeline and a few guardrails to avoid infinite-iterator pain. read on »

Python

Calling LLMs from Python: LangChain, LiteLLM, and HF Transformers

Updated: September 17, 2026

Most LLM tutorials stop at "call the API and print the output." That's demo-ready, not production-ready. In this post, we'll talk about the unglamorous stuff that keeps your app alive after real users show up: prompt templates (not string soup), retries and rate limits, streaming for better UX, caching to stop burning money, structured outputs, safe logging, and evals you can actually track. Boring? Yes. Also the difference between "cool prototype" and "doesn't page you at 2am." read on »

Python

FastAPI + Pydantic + SQLAlchemy: The Modern Python Stack

Updated: September 17, 2026

If your FastAPI project currently looks like a junk drawer (and your database session handling feels like a haunted house), this post is for you. I'm walking through the minimum "actually works in production" stack: **FastAPI** for routes, **Pydantic** for clean input/output schemas, and **SQLAlchemy** for persistence-wired together with dependency injection so you don't end up debugging global state at 2am. You'll get a sane folder layout, a single correct way to create DB sessions, boring CRUD functions (the best kind), and a quick note on how to override the DB in tests without accidentally nuking your dev data. read on »

Python

FastAPI: A Flask Developer's Guide

Updated: September 17, 2026

If you've shipped real Flask apps, you already know the deal: it's friendly, flexible, and will happily let you copy-paste input validation until you die of boredom. FastAPI is different. It shows up with typed models, automatic request validation, and API docs that generate themselves while you're still looking for your Postman collection. In this guide, I'll walk through what actually changes when you switch from Flask to FastAPI, plus a tiny CRUD conversion that won't turn into a week-long "framework migration journey." read on »

Python

How to Build a Simple RAG Pipeline in Python

Updated: September 17, 2026

RAG is just a fancy way to say: stop making the model guess when you can hand it the right notes. In this post, I walk through a simple, one-file RAG pipeline in Python-ingest, chunk, embed+index (FAISS), then retrieve+answer with citations. It's the version most teams should build first: boring, readable, and easy to debug before you start buying "enterprise" problems. read on »

Python

Python Type Hints Tutorial: Catch Bugs Before Production with mypy

Updated: March 18, 2026

Type hints won't make Python "typed," but they will stop a lot of dumb bugs before they hit prod. This post shows how hints act like inline docs, why the payoff is in messy glue code, and how tools like mypy catch problems (like passing a string where an int belongs) before runtime. It also covers Optional, Union, Callable, generics, and a sane "start where it hurts" approach-without turning your repo into a type museum. read on »

Python

12 Python Built-ins and Standard Library Tools for Cleaner, More Maintainable Code

Updated: March 18, 2026

Smart code that nobody can maintain isn't smart. This post walks through 12 boring Python built-ins and stdlib tools that make intent obvious: `enumerate()`, `zip(strict=True)`, `any()`/`all()`, `partial()`, `iter(..., sentinel)`, `filter()`/`map()`, `chain()`, `defaultdict`, `groupby()`, and `lru_cache()`. Each one cuts glue code, prevents quiet bugs, and makes the next dev's life easier-especially after the "wizard" leaves. read on »

Python

Python is Slow? Here's Why That Doesn't Matter (And How Python 3.11-3.14 Got Faster Anyway)

Updated: September 17, 2026

"Python is slow" is a lazy diagnosis. If your app spends its time waiting on Postgres, the network, or S3, the interpreter isn't the bottleneck-your queries and indexes are. CPython also got a lot faster in 3.11–3.14, often with zero code changes, and 3.14 makes the GIL optional for real parallel threads. Stop chanting. Profile first. Upgrade second. Rewrite in Rust only if the numbers force you. read on »

Newsletter

One email, once a week.

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