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-November/093711.html below:

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

[Python-Dev] Retrieve an arbitrary element from a set withoutremoving it [Python-Dev] Retrieve an arbitrary element from a set withoutremoving itSteven D'Aprano steve at pearwood.info
Wed Nov 4 12:00:49 CET 2009
On Wed, 4 Nov 2009 10:10:30 am Guido van Rossum wrote:
> On Tue, Nov 3, 2009 at 2:46 PM, Steven D'Aprano <steve at pearwood.info> 
wrote:
> > Since I was the person who decided that "arbitrary" meant "give a
> > different result each time", I should answer that.

> You're obviously talking about a *random* element. This is a separate
> use case (though I agree many people don't know the difference).

I'm aware of the difference between random and arbitrary, and in an 
earlier post I said that the One Obvious Way of getting a random 
element from a list would be to convert to a list and call 
random.choice(). Sorry for muddying the waters by linking to a page 
discussing such random selections.


-- 
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