This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add nondestructive selection to sets
Type: enhancement Stage:
Components: None Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Retrieve an arbitrary element from a set without removing it
View: 7212
Assigned To: Nosy List: eric.smith, ipatrol
Priority: normal Keywords:

Created on 2010-05-27 01:25 by ipatrol, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg106590 - (view) Author: (ipatrol) Date: 2010-05-27 01:25
I see in a lot of references for computer programming a function that returns an arbitrary value from a standard or frozen set. http://en.wikipedia.org/wiki/Set_%28computer_science%29 describes it as pick. It surprised me when I discovered that Python sets don't have this method. I would suggest the returned value be somewhat random to prevent repeated calls from returning repeated results. Perhaps a small C-level counter could control that, which can then roll over uneventfully if enough calls are made.
msg106591 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2010-05-27 01:36
This is a dupe of issue 7212.
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53076
2010-05-27 01:36:13eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg106591

superseder: Retrieve an arbitrary element from a set without removing it
resolution: duplicate
2010-05-27 01:25:08ipatrolcreate