def __init__(selfx= = )self self the two instance variablesself and self yare created in the initializerand assigned the values of the and parameters since python will find this initializer when we create new point objectthe object __init__(method will not be called this is because as soon as python has found the required method it calls it and doesn' look further object-oriented purists might start the method off with call to the base class __init__(method by calling super(__init__(the effect of calling the super(function like this is to call the base class' __init__(method for classes that directly inherit object there is no need to do thisand in this book we call base class methods only when necessary--for examplewhen creating classes that are designed to be subclassedor when creating classes that don' directly inherit object this is to some extent matter of coding style--it is perfectly reasonable to always call super(__init__(at the start of custom class' __init__(method def distance_from_origin(self)return math hypot(self xself ythis is conventional method that performs computation based on the object' instance variables it is quite common for methods to be fairly short and to have only the object they are called on as an argumentsince often all the data the method needs is available inside the object def __eq__(selfother)return self =other and self =other methods should not have names that begin and end with two underscores--unless they are one of the predefined special methods python provides special methods for all the comparison operators as shown in table all instances of custom classes support =by defaultand the comparison returns false--unless we compare custom object with itself we can override this behavior by reimplementing the __eq__(special method as we have done here python will supply the __ne__((not equalinequality operator (!=automatically if we implement __eq__(but don' implement __ne__(by defaultall instances of custom classes are hashableso hash(can be called on them and they can be used as dictionary keys and stored in sets but if we reimplement __eq__()instances are no longer hashable we will see how to fix this when we discuss the fuzzybool class later on by implementing this special method we can compare point objectsbut if we were to try to compare point with an object of different type--sayint--we fuzzybool