A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-October/093254.html below:

[Python-Dev] Retrieve an arbitrary element from a set without removing it

[Python-Dev] Retrieve an arbitrary element from a set without removing it [Python-Dev] Retrieve an arbitrary element from a set without removing itSteven D'Aprano steve at pearwood.info
Sat Oct 24 00:49:38 CEST 2009
On Sat, 24 Oct 2009 07:53:24 am Willi Richert wrote:
> Hi,
>
> surprised about the performance of for/break provided by Vitor, I did
> some more testing. It revealed that indeed  we can forget the get()
> (which was implemented as a stripped down pop()):


I don't understand that conclusion. According to your tests, your 
implementation of get() is as fast as "for x in set: break", and it's 
certainly much, much more readable and straightforward.



-- 
Steven D'Aprano
More information about the Python-Dev mailing list

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