Closed jannikluhn closed 4 years ago
It is a bit unconventional compared to the builtin types and their comparisons, but I think it provides a clearer picture to the user as to what is going on. The cases being -
True
as the points are equalFalse
as the points are not equalTypeError
this comparison does not make sense / cannot be made, and distinguishes the comparison from two points being compared but not being equalIf there's a use case where this is an issue I'm happy to reconsider, but my initial thoughts here are that this provides stronger and clearer indications of what's going on than just returning False
and not failing / throwing an exception.
Fair enough, sounds reasonable! I just stumbled over this by accident and was a little bit surprised by the behavior, so I wanted to point it out.
Checking equality of a curve point with something which is not a curve point raises a type error. Instead, I think it should return
False
which is, at least in my experience, the standard convention. (e.g.5 == "5"
,None == object()
,{} == []
).