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/093282.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
Sat Oct 24 21:37:13 CEST 2009
Guido van Rossum wrote:
> On Sat, Oct 24, 2009 at 10:34 AM, Alexander Belopolsky
> <alexander.belopolsky at gmail.com> wrote:
>> To me, however, a set seems to be a container that is a specialization
>> of a dict with values and keys being the same.
> 
> That's absurd; the mapping provides nothing useful.

Given Alexander's premise, I agree with your response. But his premise 
is wrong. Python's current builtin set class maps abstract equivalence 
classes to representative members. And this *is* useful. Mapping 
arbitrary members of such classes to representative members, sometimes 
called 'canonical', is a standard problem/goal in math. String interning 
is an application of this idea.

Terry Jan Reedy



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