The REAL Reason Python Type Hints Are Useful | Issue #51


Hi there,

We all know type hints can catch bugs before runtime. 🐛

But what if I told you they’re also one of your best tools for designing better software?

In this week’s video, I show how type hints can lead to smarter choices about inputs, outputs, and even class structure — all without adding complexity. It’s the kind of thinking that leads to better architecture and fewer “why did I do this?” moments later on. 😌

And yes, I also drop a few tips you’ve probably never heard about inputs and outputs that can seriously level up your code! ✨

Happy coding! 🐍

Cheers,

Arjan

# News

Namespaces in Python—What You Need to Know

Python’s namespace system can be sneaky… ever hit a weird NameError or had a variable act unexpectedly?

Real Python has a great breakdown of how namespaces and scope really work—without frying your brain. It’s a must-read if you’re building larger apps or just want to avoid subtle bugs. 👉 Check out the article here.

Why Python Isn't Just JSON with Functions

On the surface, Python looks a lot like JSON—but don’t be fooled. Under the hood, it’s far more expressive (and complex).

This piece from Marimo breaks down why treating Python like “JSON with functions” leads to design problems, and how understanding Python’s structure can help you write more intentional code.

If you’ve ever designed a config system, API payload, or domain model… this one will hit home. 👉 Read the full article here.

# Community

In the ArjanCodes Discord, AnxoNuevo sparked a fantastic thread about transitioning from Java to Python—and realizing they might be overusing singletons in their FastAPI microservices. The conversation quickly turned into a goldmine of practical alternatives: using app.state, dependency injection, module-level state, and even lifespan events.

Whether you’re building background schedulers, managing API tokens, or just want cleaner code architecture, this thread is packed with tips you’ll want to see.

👉 Curious how others solve this in production? Join the conversation on Discord and level up your Python service design!


Do you enjoy my content on YouTube and would you like to dive in deeper? Check out my online courses below. They've helped thousands of developers take the next step in their careers.

🚀 The Mindset Online Course Series

The goal of this series is to help junior developers grow their skills to become senior developers faster.

💥 Other Courses

💡 If you’re part of a development team at a company, I offer special packages for companies that give your team the tools to consistently write high-quality code and dramatically increase your team's productivity.

Unsubscribe | Send by ArjanCodes

Wolvenplein 25, Utrecht, UT 3512 CK

The Friday Loop

Every Friday, you'll get a recap of the most important and exciting Python and coding news. The Friday Loop also keeps everyone posted on new ArjanCodes courses and any limited offers coming up.

Read more from The Friday Loop

Hey everyone, I was reviewing some of the projects I’ve worked on over the past year, and I noticed something interesting: I almost never use Python’s @dataclass anymore. Not because it’s bad. In fact, dataclasses are still a great feature of the language. But as my projects have grown more complex, especially with tools like FastAPI, Pydantic, and SQLAlchemy, I’ve found that dataclasses just… don’t fit the way I design software anymore. In my latest video, I dive into this in detail. You’ll...

Hi there, You’ve probably heard that serverless is the easiest way to deploy code to the cloud. And on the surface, it is. With Google Cloud Functions, you can literally deploy a simple Python function like this: def hello(request): return "Hello from Cloud!" A few lines of code. No servers. No infrastructure. But... there are quite a few limitations: No FastAPI or async support One route per function requirements.txt only, no pyproject.toml Cold starts for large dependencies No custom...

Hey there, Heard of MCP? It stands for Model Context Protocol: an open standard that lets AI models like Claude or ChatGPT connect to real tools and data. In my latest video, I explain what MCP actually is, and show a working example where Claude can search YouTube videos using MCP. In the video you’ll learn: Why AI models can’t just call your API How MCP bridges that gap Two ways to structure your MCP integration Happy coding! Cheers, Arjan # News Upcoming Python Documentary CultRepo...