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/093292.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 itTerry Reedy tjreedy at udel.edu
Sun Oct 25 07:50:06 CET 2009
Alex Martelli wrote:
> Next(s) would seem good...

That does not work. It has to be next(iter(s)), and that has been tried 
and eliminated because it is significantly slower.

>> Interesting. It depends a bit on the speed of tuple unpacking, but
>> presumably that is quite fast. On my system it is pretty darn good:
>>
>> 0.101us "for x in s: break"
>> 0.112us "x, = s"

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