IronPython Bug that Cost me a Can of Coke
Kamil Dworakowski (a Resolver developer) explains an obscure bug with comparing lists in IronPython 1, and how it cost him a can of coke:
The bug relates to IComparable and value types in the underlying framework and how IronPython implements equality in an attempt to remain faithful to Python.
The bug relates to IComparable and value types in the underlying framework and how IronPython implements equality in an attempt to remain faithful to Python.
jlh@jlh-d520:~$ python
ReplyDeletePython 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=1
>>> a==a
True
>>> [a]==[a]
True
>>> a
1
>>>
Hello Omaha Python Users group. :-)
ReplyDeleteFor what it's worth the code you posted above does exactly the same thing in IronPython.
ReplyDelete>>> a = 1
>>> [a] == [a]
True
The problem in IronPython is more complex than that and applies to specific value types!