This article shows the examples of special(magic/dunder) methods in python
basic
1 | class Employee: |
__repr__ method is used for debug
1 | class Employee: |
__str__ method is used for user
1 | class Employee: |
__add__ method
1 | class Employee: |
__len__ method
1 | class Employee: |