Question: what is __eq__ in python?
Answer: Equality in Python is more complicated than most people realize but at its core you have to implement a __eq__(self, other) method. ... By default, those methods are inherited from the object class that compares two instances by their identity – therefore instances are only equal to themselves.