1. Error in != comparisons
Comparing two of most things using the != operator currently fails with the following error unless you make them lists:
In [6]: SO3() != SO3()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-16fbcbbd9d14> in <module>
----> 1 SO3() != SO3()
~/qut/repos/spatialmath-python/spatialmath/baseposematrix.py in __ne__(left, right)
1560
1561 """
-> 1562 return [not x for x in left == right]
1563
1564 def _op2(
TypeError: 'bool' object is not iterable
This is due to __ne__ assuming comparison results are a list. Commit 13d6ee1 addresses this.
2. An opinionated change to == comparisons
Currently a runtime assertion error is thrown if two things are compared of different types.
I know I would find simply receive a False return easier to work with in code, as two different types definitely aren't equal. But that's just one opinion, and I can see how the way it currently is also makes sense.
Happy for this part of the PR to be reverted if desired:
This PR has two parts.
1. Error in
!=
comparisons Comparing two of most things using the!=
operator currently fails with the following error unless you make them lists:This is due to
__ne__
assuming comparison results are a list. Commit 13d6ee1 addresses this.2. An opinionated change to
==
comparisons Currently a runtime assertion error is thrown if two things are compared of different types.I know I would find simply receive a
False
return easier to work with in code, as two different types definitely aren't equal. But that's just one opinion, and I can see how the way it currently is also makes sense.Happy for this part of the PR to be reverted if desired: