figure an instance of the fraction class with two methods fraction( fraction( print( / our fraction object now has two very useful methods and looks like figure an additional group of methods that we need to include in our example fraction class will allow two fractions to compare themselves to one another assume we have two fraction objectsf and = will only be true if they are references to the same object two different objects with the same numerators and denominators would not be equal under this implementation this is called shallow equality (see figure we can create deep equality (see figure equality by the same valuenot the same reference by overriding the __eq__ method the __eq__ method is another standard method available in any class the __eq__ method compares two objects and returns true if their values are the samefalse otherwise in the fraction classwe can implement the __eq__ method by again putting the two fractions in common terms and then comparing the numerators (see listing it is important to note that there are other relational operators that can be overridden for examplethe __le__ method provides the less than or equal functionality listing checking if two fractions are equal def __eq__(selfother)first_num self num other den second_num other num self den return first_num =second_num the complete fraction classup to this pointis shown below we leave the remaining arithmetic and relational methods as exercises review of basic python