Getting some element from sets.Set

tutufan at gmail.com tutufan at gmail.com
Thu Jun 28 18:40:39 EDT 2007


On May 9, 11:41 am, Steven Bethard <steven.beth... at gmail.com> wrote:

>      $ python -m timeit -s "s = set('abcdef')" "x = s.pop(); s.add(x)"

It's interesting that that's faster.  I'd be hesitant to use that in a
real program because it's so unattractive (as is the '.next()'
approach).  To me a builtin method would be worthwhile in this case.




More information about the Python-list mailing list