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/2000-February/002038.html below:

[Python-Dev] Set data type

[Python-Dev] Set data typeGreg Stein gstein@lyra.org
Thu, 3 Feb 2000 17:21:03 -0800 (PST)
On Thu, 3 Feb 2000, Ka-Ping Yee wrote:
>...
> So i think the clearest thing to do is to make sets a separate
> built-in type.  Here's the interface i was thinking of:

I might agree with this, but would not recommend special syntax for it. In
particular:

>     >>> s = {1, 5, 7}           # no colons means a set

Without a lot of hackery or post-parse validation (e.g. at byte-compile
time), the above syntax is not possible.

I think the follow is just as readable, if not more so:

    >>> s = set(1, 5, 7)

Where set() is a new builtin, taking an arbitrary number of arguments and
returning a new Set type.

The rest can easily follow once you have a Set object in hand.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/




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