Glossary: Python Beyond the Basics
__eq__ / __lt__
Also written: __eq__, __lt__
Special methods that define what `==` and `<` mean for your own objects. Python also uses `__lt__` when sorting, so a Product with `__lt__` can be sorted by price.
Glossary: Python Beyond the Basics
Also written: __eq__, __lt__
Special methods that define what `==` and `<` mean for your own objects. Python also uses `__lt__` when sorting, so a Product with `__lt__` can be sorted by price.