Thanks for reporting this.

Luckily this one is quite easy to fix.  The reason for this bug is that .NET 
dictionaries don't allow null as a value, and the Set class used to be backed 
off of a .NET dictionary.  But these days it's backed by a Python dictionary, 
but there's still some checks to handle null values that seem to have lingered 
on.

If you remove every instance of:

            if (o == null) o = NoneType.InstanceOfNoneType;

from IronPython\Runtime\Set.cs then you'll get rid of this bug.

I'll file a CodePlex bug on this & get it fixed for the next release.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Reade
Sent: Thursday, June 29, 2006 7:15 AM
To: Discussion of IronPython
Subject: [IronPython] Adding None to a set

Hi guys

As if you didn't have enough on your plates already...

IronPython beta8:
 >>> st = set([])
 >>> st.add(None)
 >>> st
set([<type 'NoneType'>])

CPython:
 >>> st = set([])
 >>> st.add(None)
 >>> st
set([None])

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