Skip to content

Latest commit

 

History

History

README.md

Dunder Methods

  • Dunder methods, short for "double underscore methods" and also known as magic methods, are special methods in Python that allow you to define custom behavior for built-in operations. These methods are surrounded by double underscores (e.g., __init__, __str__, __add__) and enable you to customize object creation, representation, comparison, arithmetic operations, and more. They provide a way to make your classes integrate seamlessly with Python's syntax and built-in features.

Examples

__eq__
__lt__
__add__
__format__
__repr__
__or__
__getitem__