Author terry.reedy
Recipients r.david.murray, rhettinger, steven.daprano, terry.reedy, vfaronov
Date 2016-07-29.17:56:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here is a more accurate 'equivalent': "any(x is e or <one of x==e or e==x> for e in <candidate members of y>)" where 'candidate members' is "members with the same hash as x" for built-in hash-based collections and 'all members' for built-in unsorted sequences".  I am sure that built-in range does a direct calculation.  Instead of the above, I suggest this.

"For general collections, such as list, tuple, collections.deque, and most iterables, the expression `x in y` is usually equivalent to `any(x is e or x == e for e in y)`."

Hash-based collections should not be mentioned in such a sentence as the equivalency is completely wrong, as Steven noted.
Date User Action Args
2016-07-29 17:56:26terry.reedysetrecipients: + terry.reedy, rhettinger, steven.daprano, r.david.murray, vfaronov
2016-07-29 17:56:25terry.reedysetmessageid: <>
2016-07-29 17:56:25terry.reedylinkissue27605 messages
2016-07-29 17:56:25terry.reedycreate