Python Decorators Considered Harmful | Issue #50


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 make debugging harder
  • How the wrong order of decorators can silently break your app
  • Why some decorators expect hidden arguments (and how that messes up your code)
  • The few cases where decorators actually make sense

If you want to write better, cleaner Python, this video is a must-watch. 🚀

Happy coding! 🐍

Cheers,

Arjan

# News

Meet DuckDB: The Sqlite of Analytics… but Actually Fast 🦆

Still wrestling with CSVs in pandas or stuffing everything into PostgreSQL just to get some analysis done? It might be time to level up your data workflow. 🚀

Meet DuckDB —a lightweight, blazing-fast analytical database that plays beautifully with Python, and runs in-process. That means: no server, no setup headaches, just smooth data magic. ✨

Real Python 🐍 recently published a great article breaking it all down. And if you prefer a more interactive deep dive, I made a video explaining why DuckDB is a total game-changer for Python devs and data enthusiasts alike. 🎥 You can watch it here!

🧵 Writing Async-Aware Decorators in Python

Ever tried decorating an async function and hit a wall? Tanner Young’s post is a goldmine for Python devs who want to write decorators that just work—whether the target function is synchronous or asynchronous.

He covers:

  • How to detect if a function is async
  • Why await can’t be used blindly in decorators
  • A clean pattern to support both sync + async functions

A must-read for Python devs looking to level up their async game. 👉 Check it out here.

# Community

In the #project_showcase channel, community member razorblade23 shared an exciting new tool: PyCrucible — a cross-platform builder and launcher for Python apps using Rust and uv.

It packages your app into a single executable that self-extracts, installs dependencies, and just runs. No setup required. 🛠

The project is in its early alpha phase and evolving fast, with thoughtful feedback already coming in from folks like James Parrott.

👉 Curious? Want to help shape it? Join the conversation in Discord and share your thoughts, suggestions, or test results. 💬


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 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...

Hi there, We all use def to define functions in Python. But did you know there are at least 7 other ways to do it? Some of them are useful. Some are questionable. And the last one is so ridiculous, it might crash your interpreter. In this week’s video, I walk through each method, explain how it works, why you should use it (or not), and what it teaches us about how Python works under the hood. This was a really interesting topic to explore. I learned a lot from it and I hope you will too....

Hi there, Functional programming in Python can be elegant… but not always. ⚠️ In this week’s video, I walk through four common scenarios where replacing for loops with map() and filter() actually leads to worse code. Not just less readable—but also harder to debug, more error-prone, and sometimes even misleading. We’ll dive into: Exception handling that becomes a mess inside a lambda Side effects (like writing to files) that violate functional principles Nested logic that turns into...