The dunder protocol
Double-underscore ("dunder") methods let your classes integrate with Python's language features: __init__, __repr__, __str__, __eq__, __lt__, __iter__, __getitem__, __enter__/__exit__, and more. Implementing a few lets your object work with for, comparisons, with, and arithmetic for free.