Suppose the following:
>>> s = set([1, 2, 3])
How do I get a value (any value) out of s without doing s.pop()>
s
s.pop()>
Least code would be:
>>> s = set([1, 2, 3]) >>> list(s)[0] 1
Obviously this would create a new list which contains each member of the set, so not great if your set is very large.