magic method | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

magic method

in python when we use any magic method and define it usually we use two argument self and other, can we take three or more argument there

24th Jul 2020, 3:45 PM
Kriti Pashine
Kriti Pashine - avatar
1 Réponse
0
As in sololearn it specified as "self" as class reference and "other" as other argument.There is no need to be the names are must be "self" or "other". We can use our own custom names. And in your question Yes we can use any arguments with any name inside a magic method
3rd Aug 2020, 3:36 PM
sid
sid - avatar