By: Mark Mruss
Note: This article was first published the November 2007 issue of Python Magazine
While the equality operator works great on numbers and strings the fact the way it treats your custom objects really is not that useful. This article looks into overloading the equality operator so that you can easily compare your custom classes.
- Introducing the terms: operators and operator overloading
- A Quick Example of the Default Equality Operator
- Overloading the Equality Operator
- Telling Python that the Comparison has Not Been Implemented
- The Inequality Operator