Why Does @property Work? A Deep Dive into Python Descriptors
🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I explain what descriptors are, why attribute access in Python sometimes behaves in surprising ways, and how the descriptor rules determine whether an attribute comes from the class, the instance, or somewhere else entirely. Along the way, I’ll look at a few practical design ideas that show how descriptors can help you write cleaner, more reusable Python code. 🔥 GitHub Repository: https://git.arjan.codes/2026/descriptors. 🎓 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:19 Immediately Show Code: The Smallest Descriptor You Can Watch 5:54 Build Your Own @property 8:57 Teaser Setup: The Precedence Rule (With Two Short Experiments) 11:06 Cool Design #1: Validated Fields (Write Code on Screen) 14:19 Cool Design #2: Lazy Cached Property
Watch on ArjanCodes
Opens in a new tab




