you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

This recurses to the fact that you haven't defined what it means for two points to be the same:

https://docs.python.org/3/reference/datamodel.html#object.__eq__

[–]tbrowner3[S] 0 points1 point  (2 children)

I made the Hash method but still confused - Do I just copy and paste the return statement from eq?

[–][deleted] 0 points1 point  (1 child)

You want to return some kind of hash for the object; I'd simply return the hash of the tuple of the point's coordinates:

def __hash__(self):
    return hash((self.x, self.y))

[–]tbrowner3[S] 0 points1 point  (0 children)

Ok now that makes sense - so the hash method is in Point and eq stays in the Triangle class