[IronPython] Comparing clr objects in lists
fuzzyman at voidspace.org.uk
Tue Oct 3 14:38:24 CEST 2006
Andrzej Krzywda wrote:
>We found an issue with comparing clr objects in lists.
>IronPython 1.0.60816 on .NET 2.0.50727.42
>Copyright (c) Microsoft Corporation. All rights reserved.
> >>> import clr
> >>> clr.AddReference('System.Drawing')
> >>> from System.Drawing import Color
> >>> Color.Red == Color.Red
> >>> (Color.Red) == (Color.Red)
> >>> [Color.Red] == [Color.Red]
> >>> [(Color.Red)] == [(Color.Red)]
>The same kind of comparison will work with IronPython objects.
By the way, the following are exactly equivalent :
>>> Color.Red == Color.Red
>>> (Color.Red) == (Color.Red)
If you want to try in tuples, use :
>>> (Color.Red,) == (Color.Red,)
>users mailing list
>users at lists.ironpython.com
More information about the Ironpython-users