Message11651
This doesn't only effect empty list != on a Java list with Python list will currently return True, where == also returns True e.g.
>>> from java.util import ArrayList
>>> al1 = ArrayList([1,2,3])
>>> al1 == [1,2,3]
True <================= Correct
>>> al1 != [1,2,3]
True <================= This is wrong!
I have looked into this one a bit and it seems like the issue is evaluating __ne__ for Java lists. I have a test case and a fix on a branch here https://github.com/jamesmudd/jython/tree/2639 but it might not be the best solution.
I would like to investigate a little more though as currently JavaProxyList didn't implement __ne__ which I though should be ok as it should be logically equivalent to not(__eq__) however that wasn't the code path followed (when evaluating !=) so maybe this points to a different underlying problem. If anyone has looked at this area before feel free to comment with hints. |
|
Date |
User |
Action |
Args |
2017-11-07 23:36:47 | jamesmudd | set | messageid: <1510097807.51.0.213398074469.issue2639@psf.upfronthosting.co.za> |
2017-11-07 23:36:47 | jamesmudd | set | recipients:
+ jamesmudd, Amjad |
2017-11-07 23:36:47 | jamesmudd | link | issue2639 messages |
2017-11-07 23:36:46 | jamesmudd | create | |
|