Python classes--Need explanation
<p>I have a general question on the class definition and its use..THe below code from one of the book works fine but I have a general questions.</p>

<p>Here we have defined a class Point and creating 2 instance Point1 &amp; Point2. When calculating the distance for point2, how can we pass the point1 object?</p>

<p>Isn't point1 the point object, whereas the other_point is reprented as a variable.</p>

<p>Im little confused.</p>

<p>Code:</p>

<pre><code>import math
class Point:
    def move(self, x, y):
        self.x = x
        self.y = y
    def reset(self):
        self.move(0, 0)
    def calculate_distance(self, other_point):
        print("Inside calculating distance")

        return math.sqrt(
                (self.x - other_point.x)**2 +
                (self.y - other_point.y)**2)

point1 = Point()
point2 = Point()
point1.reset()
point2.move(5,0)
print(point2.calculate_distance(point1))                    
</code></pre>
