Closed Swiftloke closed 4 years ago
Why not just define eq as return self.x == rhs.x and self.y == rhs.y and self.z == rhs.z
?
There really is no reason why not, I suppose. I just copy/pasted the __cmp__
code from the Py2 implementation and made it work for Py3- I wasn't really sure if you would want the code to look similar.
This commit adds the
__eq__
and__ne__
functions to the Vec3 class, enabling equal and not equal comparisons of the class in Python 3. Discussion should be had on support for__gt__
,__lt__
,__ge__
, and__le__
.