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.dani...@acm.org

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to