Skip to main content
AmigoFish

The Hidden Mechanism Behind Clean Python APIs (Descriptor Deep Dive)

From ArjanCodes · · 16 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.

If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.

Watch on YouTube

Not rated yet

Description

🧱 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 (Write Code on Screen) 15:50 Final Thoughts

#arjancodes #softwaredesign #python

Back to ArjanCodes · Report a problem