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/093266.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 itMartin (gzlist) gzlist at googlemail.com
Sat Oct 24 11:12:26 CEST 2009
On 24/10/2009, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Ben Finney wrote:
>> Which then raises the question “what part of the set does it get?”,
>> which the function signature does nothing to answer. I'm proposing that
>> a no-parameters ‘set.get’ is needlessly confusing to think about.
>
> The fact that set.get() is just set.pop() without removing the result
> from the set seems perfectly straightforward.

There's a different proposed meaning for `set.get` that's been
discussed on python-dev before:

<http://mail.python.org/pipermail/python-dev/2009-April/088128.html>

That one I've had cause for before and no clean and fast way of
writing, this one I've always just done the for/break thing.

Martin
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