+ 1
the dunder or magic methods __add__(), __sub__(), __gt__(),.... lets you define how +, -, >, ... behave when they are used on your custom objects. Python wouldn't know how to handle those operations when used on your objects if you don't define them. https://www.pythonmorsels.com/what-are-dunder-methods/
30th Aug 2022, 11:43 AM
Bob_Li
Bob_Li - avatar