Andrzej Krzywda wrote:

>Hello all,
>
>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
>True
> >>> (Color.Red) == (Color.Red)
>True
> >>> [Color.Red] == [Color.Red]
>False
> >>> [(Color.Red)] == [(Color.Red)]
>False
>
>The same kind of comparison will work with IronPython objects.
>
>  
>
Unlucky. :-)

By the way, the following are exactly equivalent :
>>> Color.Red == Color.Red

True
 >>> (Color.Red) == (Color.Red)
True


If you want to try in tuples, use :

 >>> (Color.Red,) == (Color.Red,)


Michael
http://www.voidspace.org.uk

>Andrzej Krzywda
>_______________________________________________
>users mailing list
>[email protected]
>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>  
>

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to