Dunder Methods
__init__
__init____bases__
__bases__class A:
pass
class B(A):
pass
class C(B):
pass
print(C.__bases__)__dict__
__dict____repr__
__repr____str__
__str__Both these dunder methods are called directly from py:
__add__
__add__Integer:
String:
By defining the __add__ dunder method you are able to add employee salaries for example:
__add__ dunder method you are able to add employee salaries for example:__len__
__len__Last updated