Details
-
Type:
Improvement
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Sprint:Science Pipelines DM-S15-1
-
Team:Data Release Production
Description
Viz:
In [1]: from lsst.afw.coord import Coord
|
In [2]: c1 = Coord("11:11:11", "22:22:22")
|
In [3]: c1 == c1, c1 != c1
|
Out[3]: (True, False)
|
In [4]: c2 = Coord("33:33:33", "44:44:44")
|
In [5]: c1 == c2, c1 != c2
|
Out[5]: (False, True)
|
In [6]: c3 = Coord("11:11:11", "22:22:22")
|
In [7]: c1 == c3, c1 != c3
|
Out[7]: (True, True)
|
c1 is simultaneously equal to and not equal to c3!
The downside to that is that %useValueEquality delegates to the C++ operator== and just negates the result when checking for inequality. By also defining an operator!= in C++ we could quite easily end up with different semantics in C++ and Python, which seems unfortunate.
(Of course, if somebody wants to define an operator!= which isn't just the complement of operator== they should probably think again, but...)