Bob Belderbos
banner
bbelderbos.bsky.social
Bob Belderbos
@bbelderbos.bsky.social
👋 Co-Founder of Pybites
🐍 Python software developer + coach
📘 Love books/ reading
One of my favorite design patterns: the Repository Pattern. 😍

It keeps business logic separate from the data layer. 📈

Need to swap SQL for CSV or add an API backend later? Plug it in, the interface stays the same.

Example below 👇
November 14, 2025 at 10:38 AM
I solved a Bite today and used collections.Counter() 🙂

Good reminder: the right data structure saves a lot of code. 🐍

In this case: apart from a small helper function, you get the top stock by symbol using most_common()

Clean, fast, readable. 🚀
November 13, 2025 at 5:29 PM
So keep an eye out on the docs to expand and challenge your Pytohnic thinking. 📈

Bonus tip below: how to un-lambda yourself.
I agree: just write a quick function, more readable + reusable (with the exception of using it inline in common built-ins like `sorted`)
November 12, 2025 at 10:39 AM
I like #Python books and reading source code for inspiration, but don't underestimate the power of the docs.

This week I learned that uuid now supports v7 and that random + sqlite3 added command-line scripts in recent versions.
November 12, 2025 at 10:39 AM
TIL #Python 3.14 comes with uuid6 and -7

And really nice: since 3.12 the uuid module can be executed as a script from the command line 📈 - so with a bit of uv we get to a pretty powerful command 😍 👇
November 11, 2025 at 11:55 AM
I really like the retry use case to demonstrate #python decorators:
July 29, 2025 at 8:32 AM
Heads up I am running another Snipster #Python training cohort next week - we'll build this cool app:
June 17, 2025 at 12:32 PM
snakeviz == nice for profiling + visualizing 💡 💪 🐍

uv run python -m cProfile -o profile.out -m script_or_package
uv add --dev snakeviz
uv run snakeviz profile.out

(Screenshot: me profiling slow Pandas code as a candidate to refactor using Polars 🔥)

#python #debugging
May 9, 2025 at 3:51 PM
🚀 Built a #Streamlit front-end on top of a #FastAPI backend for our next cohort (starting next week!) 🚀

Great stack for quickly prototyping a front-end, all #Python, no JS 😎

(For more serious web apps you definitely want JS and/or htmlx though 💡)
May 6, 2025 at 4:43 PM
TIL about the 🔥 chardet library — it guesses unknown file encodings!

📄 Write text in latin-1 ➡️ try to read as utf-8 ➡️ 💥 UnicodeDecodeError.

👨‍💻 Solution:
April 29, 2025 at 10:09 AM
𝟱 𝗰𝗼𝗼𝗹 𝘄𝗮𝘆𝘀 to use the underscore in #Python 🐍💡

• Ignore 𝘃𝗮𝗹𝘂𝗲𝘀 when unpacking

• Loop 𝗽𝗹𝗮𝗰𝗲𝗵𝗼𝗹𝗱𝗲𝗿

• Access 𝗹𝗮𝘀𝘁 𝗿𝗲𝘀𝘂𝗹𝘁 in REPL

• Format 𝗹𝗮𝗿𝗴𝗲 𝗻𝘂𝗺𝗯𝗲𝗿𝘀

• Define "𝗽𝗿𝗶𝘃𝗮𝘁𝗲" methods (convention)

See below 👇
April 25, 2025 at 2:05 PM
Potentially underused #Python 🐍 feature: 𝘀𝗲𝘁 𝗼𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 💡

Here's an example how we can remove or update tags, casting new + old into sets, then performing 𝘴𝘦𝘵 𝘰𝘱𝘦𝘳𝘢𝘵𝘪𝘰𝘯𝘴 🔥

Have you used them, how? 😍

(Still on the fence about 𝘸𝘢𝘭𝘳𝘶𝘴, but couldn't bear doing 𝘴𝘵𝘳𝘪𝘱() twice 😅)
April 25, 2025 at 6:16 AM
Making a temporary file/dur is very useful for 𝘁𝗲𝘀𝘁𝗶𝗻𝗴.

In the example below, we first use 𝘛𝘦𝘮𝘱𝘰𝘳𝘢𝘳𝘺𝘋𝘪𝘳𝘦𝘤𝘵𝘰𝘳𝘺 to create 5 temp files.

This is a great example of using a 𝗰𝗼𝗻𝘁𝗲𝘅𝘁 𝗺𝗮𝗻𝗮𝗴𝗲𝗿 — a clean way to automatically clean up resources.

pytest makes it even easier using the 𝘵𝘮𝘱_𝘱𝘢𝘵𝘩 fixture:
April 23, 2025 at 9:14 AM
Do you know all these 5 powerful uses of * in #Python?

– Keyword-only args
– Extended unpacking
– Flexible funcs with *args
– Unpack into func calls
– Merge iterables

👇 See examples below — which ones do you use the most, and which ones are new to you?

#coding #tips
April 18, 2025 at 8:37 AM
Becoming a proficient #Python dev isn’t just about syntax, it’s about building usable apps with clean, testable, well-structured code.

That’s what we coach in our 6-week cohort starting next month.

Real apps. Real feedback. Real growth. 💪

More info: pybitescoaching.com
April 17, 2025 at 3:20 PM
A common #Polars saying:

"𝙄 𝙘𝙖𝙢𝙚 𝙛𝙤𝙧 𝙩𝙝𝙚 𝙨𝙥𝙚𝙚𝙙, 𝙗𝙪𝙩 𝙨𝙩𝙖𝙮𝙚𝙙 𝙛𝙤𝙧 𝙩𝙝𝙚 𝙨𝙮𝙣𝙩𝙖𝙭" 😍

I see why now — it's 𝗯𝗲𝗮𝘂𝘁𝗶𝗳𝘂𝗹 and 𝗳𝗮𝘀𝘁. 📈

Switched from Pandas?
What’s been your biggest win (or pain)? 🤔

#Python #Rust #DataAnalytics
April 16, 2025 at 8:35 AM
After just 3 weeks in our upcoming cohort (halfway point), you’ll have a working CLI journal app:

✅ Typer
✅ clean code
✅ testing
✅ real end-to-end project

We’ve coached 100s of devs 1:1 — now bringing that magic to our new cohort programs 🎉

🔗 pybitescoaching.com
April 15, 2025 at 12:02 PM
De-duped our books category page by reconciling similar titles, e.g.

think & grow rich → think and grow rich
everything is f*cked → everything is # @%!ed

Just stdlib -> `difflib`, no external deps 🚀

(Fun fact: Django’s manage.py uses this too btw 😎)

#python #tips
April 14, 2025 at 8:56 AM
Pydantic is awesome for data cleaning + validation, but if you want something quick + stdlib only, you can also use dataclasses + `__post_init__` 🐍 😍 - see example below. 🚀

#python #tips
April 11, 2025 at 9:40 AM
If you struggle to understand #Python OOP, why not pull from one of the most famous allegories in #philosophy — Plato’s Cave? 💡
April 2, 2025 at 11:54 AM
Who has experienced this?

#AI tools: quick wins, but more + longer debugging?

(image source: www.reddit.com/r/Programmer...)
April 2, 2025 at 11:52 AM
List vs Generator in Python 🐍💡

List: 835MB, 0.99s
Generator: 192B, 0.00s 😲

• Use `sys.getsizeof()` to check memory.
• Use generators when you don’t need all values at once.

Small change, big difference! 📈

#Python #tips #performance
March 20, 2025 at 7:59 AM
@Pybites Books v2 is live! 🚀

Simple, fast book tracking that incentivizes you to keep #reading 😎

Gamified, clean design (Tailwind + Htmx 🙏), and loved by users already. 😍

Let’s keep #books alive 💡, especially in this day and age. 📈

Try it → pybitesbooks.com 📚
March 19, 2025 at 3:13 PM
"In the face of ambiguity, refuse the temptation to guess." 💡

Python prefers clarity over assumptions:
• No implicit type coercion
• One null: None
• Mandatory indentation = no dangling if
• Type hints + mypy = catch bugs early

>>> import this 🐍

#Python #DevTips #Coding
March 18, 2025 at 8:18 AM
Subclassing dict or list in Python? Beware! 😱 Some built-in methods bypass your overrides.

✅ Use collections.UserDict & UserList instead! They ensure all operations respect your methods.

🚀 Cleaner, predictable behavior.

#Python #tips
March 14, 2025 at 3:34 PM