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.

Author rhettinger
Recipients belopolsky, benjamin.peterson, rhettinger, wrichert
Date 2009-11-05.18:42:04
SpamBayes Score 8.537456e-10
Marked as misclassified No
Message-id <1257446527.81.0.162339678343.issue7212@psf.upfronthosting.co.za>
In-reply-to
Content
After a long discussion on python-dev, this proposal is rejected in
favor of adding documentation notes on the ways to non-destructively
retrieve an arbitrary item from a set or frozenset.

Here is an except from the end of the thread:

[Steven D'Aprano]
>> Anyway, given the level of opposition to the suggestion, I'm no longer
>> willing to carry the flag for it. If anyone else -- perhaps the OP --
>> feels they want to take it any further, be my guest.

[geremy condra]
> I've said before that I'd like there to be one, standard way of
> doing this. A function call- set.pick() seems reasonably named
> to me- is probably the cleanest way to do that. Absent that,
> an example in the docs that illustrates the preferred idiom
> would be great. 

[Raymond]
Summarizing my opposition to a new set method:
1) there already are at least two succinct ways to get the same effect
2) those ways work with any container, not just sets
3) set implementations in other languages show that this isn't needed.
4) there is value to keeping the API compact
5) isn't needed for optimization (selecting the same value in a loop
makes no sense)
6) absence of real-world code examples that would be meaningfully improved

[Terry Reedy]
Agreed

[Raymond]
I would be happy to add an example to the docs so that this thread
can finally end.

[Eric Smith]
Please do!

[Terry Reedy]
Yes!
'''


Leaving this open until I've done the documentation patch.
History
Date User Action Args
2009-11-05 18:42:08rhettingersetrecipients: + rhettinger, belopolsky, benjamin.peterson, wrichert
2009-11-05 18:42:07rhettingersetmessageid: <1257446527.81.0.162339678343.issue7212@psf.upfronthosting.co.za>
2009-11-05 18:42:05rhettingerlinkissue7212 messages
2009-11-05 18:42:04rhettingercreate