If you want to update your copy the fix is to update these methods in list.cs:

        public bool __contains__(object item) {
            for (int i = 0; i < size; i++) {
                if (Ops.IsTrue(Ops.Equal(data[i], item)))
                    return true;
            }
            return false;
        }

And then later in the file:     

        public int index(object item) {
            return index(item, 0, size);
        }

        public int index(object item, int start) {
            return index(item, start, size);
        }

        public int index(object item, int start, int stop) {
            //??? fix indices
            for (int i = start; i < Math.Min(stop, size); i++) {
                if (Ops.IsTrue(Ops.Equal(data[i], item))) return i;
            }
            throw Ops.ValueError("list.index(item): item not in list");
        }

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J. de Hooge
Sent: Monday, December 12, 2005 4:32 AM
To: 'Discussion of IronPython'
Subject: [IronPython] bug: list.index broken in transition from ip 0.9.5 to ip 
0.9.6

LS


Yet another disguise of probably the same underlying bug:

aList = [['a']]
anItem = ['a']

print aList.index (anItem)

Traceback (most recent call last):
   at __main__.Initialize() in C:\activ_dell\prog\fun\src\funTry.py:line 4
ValueError: list.index(x): x not in list


The number of workarounds in my code is getting a bit too big now, since I
am using this everywhere.

Unfortunately I'll have to revert to 0.9.5 awaiting these things to be
fixed.


Guys, you've been making a great product upto now.
My sincere respect for that.
As far as I can see the IP team has been impressively productive.
Don't know what the project pressures are, but please keep taking the time
you need!

I'd personally rather wait some more months for 1.0 than having things done
in a rush.

I propose basic stuff like this is added to the regression test suite.


Kind regards
Jacques de Hooge
[EMAIL PROTECTED]



_______________________________________________
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