5 ms·
Would you consider a constructor magic though?
by 63stack 1y ago
Would you consider a constructor magic though?
- lou1306 1y ago"Magic methods" is just the name people use for these special methods (another is dunder methods). They're "magic" because you do not call them by name, rather they are invoked by the interpreter in specific situations.
- dragonwriter 1y agoYes, it is magic the same way other magic methods are, that is, because it is syntactically special and callable (and primarily called by) a syntax other than <instance>.<method>(...) or <class>.<method>(instance, ...) Specifically, in the case of constructors, via <class>(...).