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

Jan van Eijklaan 2-4, Bilthoven, UT 3723 BC

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

Hi there, If you’ve ever used Python decorators, you know they look like a clean way to add functionality. But have you ever struggled to debug a decorated function? Or wondered why your type hints suddenly break? Or spent way too much time figuring out why your decorators aren’t working as expected? 🫠 🚨 Decorators introduce hidden complexity that can turn your code into a nightmare. And honestly? I think they’re overused. In this week’s video, I explain: Why decorators break type safety and...

Hi there, Ever looked at your old code and felt secondhand embarrassment? Yeah, me too. Keeping your code simple and maintainable is an art. In today’s video, I break down 10 essential tips that will help you write cleaner, more efficient Python code. 🚀 Some key takeaways: 🛑 Stop overengineering—simple solutions are often the best. ✂️ Cut the copy-paste habit—DRY code is maintainable code. 🧹 Refactor before your code turns into a horror movie. Happy coding! 🐍 Cheers, Arjan # News How Do...

Hi there, Have you ever hesitated before hitting git merge or git rebase because… well, who actually understands Git? 🤯 Good news! In this week’s video, I walk through a real-world FastAPI project and show exactly how to merge, fast-forward, and rebase—step by step. No fluff, just practical Git skills you’ll actually use. Plus, I’m sharing some advanced Git tricks to make your workflow smoother. Happy coding and enjoy the video! Cheers, Arjan # News Build TUI Apps with Python’s Textual Ever...