(Summing up the answers given in the comments)
Your method is as good as any, with the caveat that from Python 2.6 you should use next(iter(s)) , not iter(s).next() .
If you need a random element, not an arbitrary one, use the following:
import random random.sample(s, 1)[0]
Here are some examples that demonstrate the difference between the two:
>>> s = frozenset("kapow") >>> [next(iter(s)) for _ in range(10)] ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
>>> import random >>> [random.sample(s, 1)[0] for _ in range(10)] ['w', 'a', 'o', 'o', 'w', 'o', 'k', 'k', 'p', 'k']
source share