Thanks for the bug report, William, sending them to the alias is just fine.

Martin

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Reade
Sent: Wednesday, December 21, 2005 6:01 AM
To: Discussion of IronPython
Subject: [IronPython] Comparing enum to None

Hi, we have a bug report. The following code:

------------------------------------------------------------------
import sys
sys.LoadAssemblyByName("System.Windows.Forms")
from System.Windows.Forms import *

if 1 == None:
    print "won't happen"

if DialogResult.Cancel == None: # boom!
    print "won't happen"
------------------------------------------------------------------

...raises a NullReferenceException, as follows, at the marked line.

------------------------------------------------------------------
Unhandled Exception: System.NullReferenceException: Object reference not 
set to
an instance of an object.
   at IronPython.Objects.EnumOps.Equal(Object self, Object other)
   at IronPython.Objects.Ops.Equal(Object x, Object y)
   at __main__.Initialize() in H:\dev\current\sandbox\testenumnone.py:line 8
------------------------------------------------------------------

We feel the expression should just evaluate to False.

Incidentally, should we be bothering the list with these things, or 
should we put them directly into the bug tracker?

Cheers
William
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to