John Arbash Meinel wrote: > res = heads(node1, node2) > if len(res) == 1: > # What is the 'obvious' way to get the node out? > > I posit that there *isn't* an obvious way to get the single item out of > a 1-entry frozenset. > > for x in res: break > list(res)[0] > set(res).pop() > iter(res).next() > [x for x in res][0] > x, = res # I didn't think of this one before recently > > Are all answers, but none of them I would consider *obvious*. And from my SQL-hacking experience: x = min(s) --Scott David Daniels Scott.Daniels at Acm.Org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4