3 ms·
That is just a method for an object. And the "double double underscore" thing is more of a way to show that the method is specialized and that there is no good
by rglullis 11y ago
That is just a method for an object. And the "double double underscore" thing is more of a way to show that the method is specialized and that there is no good reason to be redefining it. Nothing magic happens on the runtime in your application if you redefine the method.
If these would count as "magic", so would any language that supports operator-overloading and templates, which basically means that even C and C++ have "magic strings".
Still, you got close. If there is one thing that I could accept as "magic" is the fact that Python changes the accessor of functions if the function name starts with double underscore (but not if it also ends with double underscores). Even that would be debatable, because the behavior is well-defined and the transformation is simple.