[IronPython] IronPython.Objects.List doesn't support GetHashCode()

Chris Anderson chrisan at gmail.com
Thu May 12 07:08:09 CEST 2005

Is there any special reason why this is the case? The code currently reads:

        public override int GetHashCode() {
            throw Ops.TypeError("list object is unhashable");

So it's obviously intentional… however, I'm trying to use a native
Python list as a data source for UI binding, and the collection needs
to support GetHashCode? Is there any harm in implementing this method
to just return the object identity hash?

(similiar issue is true for SyncRoot on List also)

More information about the Ironpython-users mailing list