[issue6826] Add __contains__ to range type

2009-09-02 Thread Joseph Thomson
New submission from Joseph Thomson joseph.thom...@gmail.com: The range type should implement the __contains__ method. Currently an expression like 'x in range(1000)' will iterate through every item in the range (exiting when an item tests true for equality); this is highly unnecessary

[issue1766304] improve xrange.__contains__

2009-09-02 Thread Joseph Thomson
Joseph Thomson joseph.thom...@gmail.com added the comment: Seeing as the range type has most likely stabalised by now, I would like to renew this issue. The current behaviour of range/xrange could introduce unforeseen performance issues if users are not aware of its inner workings. Also, as I