Bob Belderbos
banner
bbelderbos.bsky.social
Bob Belderbos
@bbelderbos.bsky.social
Co-founder @pybites.bsky.social. Python developer & coach helping devs level up with project-based learning & modern Python. Start here → https://pybit.es
Advent of Code solving is one thing — the real 2–3× value is in refactoring afterwards, finding new creative ways of doing things. 💡
December 16, 2025 at 4:00 PM
We are all AI developers now in a sense ...

The game has changed. With AI handling more routine coding tasks, the developers who will lead the future are the ones who can transcend their traditional role.
December 15, 2025 at 2:43 PM
jq is really cool for ad-hoc JSON inspection/ parsing (of course use Python when it turns into more of a program) ->
December 12, 2025 at 2:54 PM
Set operations are so concise in #Python 🐍😍

Here's a neat way to get the characters that appear in every group 👇

`set.intersection(*...)` returns the items that exist in all given sets. It can take multiple sets as args, which we "splat" (`*`) unpack from a gen expression.
December 11, 2025 at 8:41 AM
TIL that >= #python 3.10 you can call `total()` on a Counter object:
December 11, 2025 at 8:39 AM
Always more concise ways to do things in #Python 🐍 😍

>>> from operator import mul
>>> from functools import reduce
>>> reduce(mul, [1, 2, 3, 4])
24

Turns out that since 3.8 the math module has `prod` ->

>>> from math import prod
>>> prod([1, 2, 3, 4])
24
December 8, 2025 at 1:34 PM
I built my first TUI for the @pybites monthly code challenge, I really like Textual so far! 🚀

It's a wrapper around a script I made the other day to benchmark code quality ->
December 5, 2025 at 11:05 AM
Refactoring win from a Codeflash the other day 👇

I only needed the worst N files / most complex N functions…
but the code was doing a full sort and then [:top_n].
December 4, 2025 at 3:00 PM
Refactored a long if/elif ladder into match/case the other day 👇

`case 1 | 2` groups opcodes that share behavior

`case 5 if part2` keeps the extra condition right next to the logic ("flat is better than nested")

Feels more like a clean dispatcher than a pile of conditionals.
December 3, 2025 at 3:00 PM
Writing your own list chunking helpers? Check out #Python’s `itertools.batched()` that can do this for you 🚀

✅ Works with any iterable.
✅ Handles a smaller final chunk automatically.
✅ Use `strict=True` (Python 3.13+) to raise a `ValueError` when the final batch isn’t full.
December 2, 2025 at 2:00 PM
I was reading Kobzol’s excellent article “Writing #Python like it’s #Rust”, and it perfectly captures how Rust can upgrade the way you write Python. 💡

Here are some takeaways I keep coming back to:
December 1, 2025 at 3:00 PM
From ~9 seconds to ~0.1 seconds… just by changing the data structure.

In a recent @Pybites code ensemble session we tackled an Advent of Code puzzle where you repeatedly “react” a polymer string by removing adjacent units like aA / Bb.
November 30, 2025 at 3:00 PM
From messy to clean numbers with `removeprefix` / `removesuffix`

With `removeprefix("$")` and `removesuffix(suffix)` you strip only what you *expect* to be there, then `float(cap) * multiplier` does the rest.

Classic EAFP: try to parse, fall back to `0.0` when the data is junk.
November 29, 2025 at 1:00 PM
Cool debugging trick I picked up from this article:

Django bulk_update memory issue
blog.pecar.me/django-bulk...

Logging memory usage in #Python using `psutil` - example below 👇

Bonus: comparing list comp vs gen expression 🐍 😍 📈
November 28, 2025 at 1:00 PM
Really enjoyed my chat with Kishan Patel on our @pybites podcast.
November 27, 2025 at 12:17 PM
Reposted by Bob Belderbos
We decided to do something different for #BlackFriday

Instead of selling you "content," we're discounting "accountability."

For the first time, we've slashed the price on our #Python Snipster (Intermediate) and Foundations (Beginner) cohorts (30-35% off).
November 27, 2025 at 11:54 AM
Python tip 🐍 itertools.groupby() for the win 🧠

Context: I was solving an AoC which required a valid password to have a digit that appeared in a run of exactly two (not part of 111 or 2222, etc).
November 26, 2025 at 3:00 PM
Reading 'Learn #Rust in a Month of Lunches' by David MacLeod 🦀

It explains concepts really well by using easy to understand analogies, for example around ownership and borrowing, which can be hard to grasp at first. 💡
November 25, 2025 at 1:00 PM
One of my favourite #Python tooling combos right now: Vim + Ruff. 🔥

For a long time I ran Ruff (linter and formatter) via pre-commit, which is great… but I kept getting slightly annoyed at how often I’d:
November 24, 2025 at 10:07 AM
I needed to see which packages were pulling in six.

Two ways:

- uv tree --package six --invert → quick “who depends on this?” from uv.lock

- uv pip tree --package six --invert --show-version-specifiers → more pipdeptree-style, constraint-aware view from the actual env
November 23, 2025 at 1:00 PM
Nice way to learn more Rust 🦀 (or other target language) 🚀

- take an AoC, solve it in Python (no AI)
- now you have a spec + approach
- rewrite in target lang (use AI tools to help debug + explain things)

This easily led to >=3 learning moments today I can now write about 💡
November 22, 2025 at 10:36 AM
🎙️ New podcast: Building reactive Python notebooks with #Marimo 💪🚀

Have you tried Marimo yet?

It fixes a lot of classic Jupyter pains: hidden state, brittle execution order, and notebooks that are hard to reuse.
November 21, 2025 at 3:00 PM
Reposted by Bob Belderbos
Did you know you can search our #Python content from the command line?

It's one of our open source libraries called `pybites-search`

Easy to run (alias) using uvx:
November 20, 2025 at 11:35 AM
I love `all()` but sometimes a set operation is more succinct in #Python

Here `issubset` reads as:

"Are all required checks contained in what’s done?"
November 20, 2025 at 11:00 AM
From explicit to declarative / expressive #Python

Had a super cool ensemble coding session today solving the “Analyze stock data” Bite. 🚀

It was a great reminder of how far you can refactor a function by leaning on built-ins 🐍

Here’s how our final function evolved:
November 19, 2025 at 4:21 PM