Get item from set

Aahz aahz at pythoncraft.com
Wed Apr 29 10:23:44 EDT 2009


In article <gt8v37$kib$03$2 at news.t-online.com>,
Peter Otten  <__peter__ at web.de> wrote:
>Aahz wrote:
>> In article <gt1kb7$jqg$03$1 at news.t-online.com>,
>> Peter Otten  <__peter__ at web.de> wrote:
>>>
>>>Here's a trick to find the actual element. I think Raymond Hettinger
>>>posted an implementation of this idea recently, but I can't find it at the
>>>moment.
>> 
>> Your code is inverted from Raymond's:
>
>I can't see the inversion.

You were wrapping the objects inserted into the set; Raymond's trick
involved only wrapping the comparison object.  It's therefore much more
convenient.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair



More information about the Python-list mailing list