here is the first shot to provide a faster means of retrieving an arbitrary
element from a set without removing it.
The times for
from timeit import *
stat1 = "for i in xrange(100): iter(s).next()"
stat2 = "for i in xrange(100): s.get()"
for stat in [stat1, stat2]:
t = Timer(stat, setup="s=set(range(10000))") # outside the
The patch is attached. Feel free to criticize.
I would love to see something like that in the standard Python interpreter.