[issue7212] Retrieve an arbitrary element from a set without removing it

2010-05-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Use set.pop(). Or if you don't want mutation, then use next(iter(s)) or next(iter(s),default). This technique also works for any collection including dicts and deques and whatnot. -- ___ Python tracker

<    1   2