bug: ExtgensionLocalValue is missing __ne__ support and comparison fails
Closed this issue · 0 comments
leon1995 commented
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Comparing two ExtensionLocalValue
using !=
operator uses the __ne__
method of list
Expected Behavior
Should be use the compare method
Minimal Reproducible Example
xml1 = fromstring(b"""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ext:Extension xmlns:ext="__ExtensionPoint__"
xmlns:pm="http://standards.ieee.org/downloads/11073/11073-10207-2017/participant">
<what:ItIsNotKnown xmlns:what="123.456.789"><what:Unknown>What does this mean?</what:Unknown></what:ItIsNotKnown>
</ext:Extension>""")
xml2 = fromstring(b"""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ext:Extension xmlns:ext="__ExtensionPoint__" xmlns:what="123.456.789">
<what:ItIsNotKnown><what:Unknown>What does this mean?</what:Unknown></what:ItIsNotKnown>
</ext:Extension>""")
inst1 = ExtensionLocalValue([xml1])
inst2 = ExtensionLocalValue([xml2])
inst1 != inst2 # returns True, should return False
Solution proposal
Extending ExtensionLocalValue
with
def __ne__(self, other):
return not self == other
Python Version
3.11
Operating system
win64
Sdc11073 Version
1.3.0
Link to sdc11073 Logs
No response
Further Information
No response
Participation
- I am willing to submit a pull request to fix this bug.