The magic method part seriously needs more examples which explanation + add but what is the full ability of __add__ and others? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

The magic method part seriously needs more examples which explanation + add but what is the full ability of __add__ and others?

6th Apr 2019, 7:39 AM
jack froster
jack froster - avatar
2 Respuestas
+ 2
jack froster is that a suggestion? If yes then you can send your suggestions at info@sololearn.com
6th Apr 2019, 8:19 AM
Шащи Ранжан
Шащи Ранжан - avatar
+ 2
It is a large topic, you'd never be able to cram it in such a brief tutorial. Read for example here: https://docs.python.org/3/reference/datamodel.html The 'magic' about the methods is that they are called although you never (specifically) call them. They are mainly meant to control the behavior of operators or the builtin functions on your selfmade type.
6th Apr 2019, 10:18 AM
HonFu
HonFu - avatar