Why dunder?

Published May 12, 2026

A little while ago, someone asked in the Python Discord "Why dunder?" It turns out that they were pretty new to programming and had more questions than just that. And we went into answers about "why dunder?" including examples for specific ones like __str__ and __add__, the basic ones. I realized as the conversation went on that the question wasn't so much "why dunder?" but more "what is dunder?" and that got me thinking. I think I came up with a pretty good answer to that question and I decided I wanted to share it.

"Your class's methods define how other programmers interact with your class. Your class's dunder methods define how Python interacts with your class."

I don't know if this is profound. I'm sure someone, somewhere, will feel like pointing out the cases where it's not. But, in my humble opinion, it's a pretty good explanation for someone who is new to Python..


Previous: Getting the right virtual environement Next: Contributing to CPython