I am learning about method binding and am trying to understand, how the interpretor makes the connection between an object of a specific type and it's instance methods. Suppose I have written the following code:
class Point:
def __init__(self, x,y):
self._x=x
self._y=y
def draw(self):
print(self._x, self._y)
p1=Point(1,2)
p1.draw()
I was told that draw is an instance method. If that's the case, then where is draw stored? I understand that attributes are stored in a dictionary whose keys are the attribute names and the values are the values of the attributes, but I'm struggling to make the connection between the instance methods and the object itself. Are they stored where the class is stored in memory or are they stored with the object(p1)? How?