I have a situation in my code where there is a Frozenset
which contains a single number (e.g. Frozenset([5])
). What I want to do is get that value into a variable. What is the pythonic way to do this?
Since you can iterate over a Frozenset
, I have already tried to do it like this: var = next(myFrozenSet)
but it does not work, since a Frozenset
is not actually an iterator.
I also tried to use myFrozenSet.pop()
, but this is not attribute of Frozensets
.