[IronPython] in - operator got broken in transition from 0.9.5 to 0.9.6

J. de Hooge info at geatec.com
Mon Dec 12 12:28:05 CET 2005


LS

 

Following code:

===============

 

 

aList = [['a']]

anItem = ['a']

 

print '1', anItem in aList

 

for item in aList:

      if item == anItem:

            print '2', True

            break

else:

      print '2', False

 

 

 

In IP 0.9.6 prints:

===================

 

2 False

2 True

 

 

In IP 0.9.5 prints:

===================

 

1 True

2 True

 

 

In Cpython 2.4 prints:

======================

 

1 True

2 True

 

 

Following Cpython 2.4 manual 1 and 2 should print the same thing:

=================================================================

 

[QUOTE]

For the list and tuple types, x in y is true if and only if there exists an
index i such that x == y[i] is true.

[UNQUOTE]

 

 

Kind regards

 

Jacques de Hooge

info at geatec.com

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20051212/bcb07713/attachment.html>


More information about the Ironpython-users mailing list