I would like to get an element from a frozenset
(without modifying it, of course, as frozenset
s are immutable). The best solution I have found so far is:
s = frozenset(['a'])
iter(s).next()
which returns, as expected:
'a'
In other words, is there any way of 'popping' an element from a frozenset
without actually popping it?