Why Your Code Isn’t Pythonic (And How to Fix It)
💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. What does it actually mean to write *Pythonic* code? In this video, we answer that question by taking a small, messy script and refactoring it step by step using the core principles of idiomatic Python. Along the way, you’ll learn how to think like a Pythonista: using functions instead of unnecessary classes, leveraging dataclasses, writing readable control flow, embracing tools like pathlib and logging, and applying the Zen of Python in practice. 🛍️ Check out ArjanCodes merch: https://shop.arjancodes.com. 🔥 GitHub Repository: https://git.arjan.codes/2025/pythonic. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:18 What does Pythonic mean? 2:08 Before 3:13 Step 1 – Prefer Functions Over Classes 4:32 Step 2 – Use Context Managers 6:42 Step 3 – Add Type Annotations 10:46
Watch on ArjanCodes
Opens in a new tab




