[IronPython] Lists of instances of classes
Giles Thomas
giles.thomas at resolversystems.com
Wed Jan 4 19:02:39 CET 2006
Hi,
We've found what looks like a bug in list comparison:
---------------
IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> class C:
... pass
...
>>> c1 = C()
>>> c2 = C()
>>> [c1, c2] == [c2, c1]
True
>>> [c1] == [c2]
True
>>> c1 == c2
False
>>>
-----------------
Confirmed in 0.9.5, 0.9.6, and 1.0.2190
There is a horrible hack to work around it:
-----------------
>>> str([c1, c2]) == str([c2, c1])
False
-----------------
Cheers,
Giles
More information about the Ironpython-users
mailing list