Best way to extract an item from a set of len 1

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Wed Jan 25 10:13:35 EST 2006


Tim Chase:
>When you have a set, known to be of length one, is there a "best" 
>("most pythonic") way to retrieve that one item?

e = s.copy().pop() #:-)

-- 
René Pijlman

Wat wil jij worden?  http://www.carrieretijger.nl



More information about the Python-list mailing list