appendix classes you will note that we directly accessed the attributes of the otherpoint object from within the distance(method implemented earlier but we used the getx(and gety(methods to access the same values within the line class the reason for this is that otherpoint is an instance of the same class as the method we were implementing in that caseit' acceptable to directly access its attributes without violating the protection in the case of the line classhoweverisvertical(and slope(are not part of the point class thuswe must access the values stored in the attributes of the two points by using the getx(and gety(access methods or we would violate the protection in this case overloading operators in pythonwe can define and implement many of the standard python operators such as +*and =as part of our user-defined classes this allows for more natural use of the objects instead of having to call specific methods by name for examplesuppose we want to include an operation for comparing two point objects to determine if they are the equal instead of including named method such as isequal()we can implement the special method eq class point def __eq__selfrhspoint )return self xcoord =rhspoint xcoord and self ycoord =rhspoint ycoord which python automatically calls when point object is used on the lefthand side of the equality operator (==)if pointa =pointb print"the points are equal if we need to determine if point is at the originwe can also use the equality operator by first creating an unnamed point object whose coordinates are both set to zeroif pointa =point( print"the point is at the origin we can overload any of the operators by including special method in our class definition table provides list of the operators and the corresponding special methods that must be defined some of the special methods are actually called when an instance of the class is passed to built-in function suppose we define the str method as part of our point classclass point def __str__self )return "(str( "str( ")