[Python-ideas] get method for sets?
Mike Meyer
mwm at mired.org
Wed May 16 08:32:15 CEST 2012
Is there some reason that there isn't a straightforward way to get an
element from a set without removing it? Everything I find either
requires multiple statements or converting the set to another data
type.
It seems that some kind of get method would be useful. The argument
that "getting an arbitrary element from a set isn't useful" is refuted
by 1) the existence of the pop method, which does just that, and 2)
the fact that I (and a number of other people) have run into such a
need.
My search for such a reason kept finding people asking how
to get an element instead. Of course, my key words (set and get) are
heavily overloaded.
thanks,
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the Python-ideas
mailing list