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/2002-October/029545.html below:

[Python-Dev] PEP 218 update questions

[Python-Dev] PEP 218 update questionsBrett Cannon drifty@bigfoot.com
Sun, 13 Oct 2002 14:43:27 -0700 (PDT)
[A.M. Kuchling]

> How would instances of a built-in immutable set type be created?
> Would there be a second immutable_set() built-in, or would the set()
> function take an additional argument: set(iterable, immutable=True)?
>

I say have a single set() with an argument flag.  Mutable or not, they are
both subsets of BaseSet and thus should be reflected in the constructor
function.

> 2)
> The PEP proposes {1,2,3} as the set notation and {-} for the empty
> set.  Would there be different syntax for an immutable and a mutable
> set?
>

As long as mutable sets can be automatically converted to immutable, I say
keep only one syntax.  If the user wants to explicitly create an immutable
set, call set(mutable_set, immutable=True) or have a very explicit way for
mutable sets to turn themselves into immutable sets.  No need to add more
syntax for something that can automatically be done for the user.

-Brett C.




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