0
What is the main reason for using magic methods?
I understand how the code compiles step by step but I am not getting why we need to use magic methods and operator overloading. Can anyone please help me with clear explanation of this?
1 Antwort
+ 4
They allow for synthax simplifications. They can turn obj1.add(obj2) into obj1 + obj2 for example.