Skip to content

Commit

Permalink
Improved Vector.__hash__ algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
gumyr committed Dec 15, 2024
1 parent d7c73e1 commit 6cb574c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/build123d/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def __eq__(self, other: object) -> bool:

def __hash__(self) -> int:
"""Hash of Vector"""
return hash(round(self.X, 6)) + hash(round(self.Y, 6)) + hash(round(self.Z, 6))
return hash((round(self.X, 6), round(self.Y, 6), round(self.Z, 6)))

def __copy__(self) -> Vector:
"""Return copy of self"""
Expand Down

0 comments on commit 6cb574c

Please sign in to comment.