From 5e7d3e4ad0ccf6c3cbbb52a3caaa213ccd7a6faa Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 27 Apr 2006 17:48:03 +0000 Subject: [PATCH] Add set literals. Clarify that the new string type will be 'str'. --- pep-3100.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pep-3100.txt b/pep-3100.txt index 1328188c9..b368d3011 100644 --- a/pep-3100.txt +++ b/pep-3100.txt @@ -104,6 +104,12 @@ Core language and semantics is evil. * Attributes on functions of the form ``func_whatever`` will be renamed ``__whatever__`` [25]_ +* Set literals and comprehensions [27]_ + {/} means set(); {x} means set([x]); {x, y} means set([x, y]). + {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). + NB. {range(x)} means set([range(x)]), NOT set(range(x)). + There's no frozenset literal; they are too rarely needed. + The {/} part is still controversial. To be removed: @@ -129,6 +135,7 @@ Atomic Types * Remove distinction between int and long types [1]_ (int may become an abstract base type, with short and long subtypes.) * Make all strings be Unicode, and have a separate bytes() type [1]_ + The new string type will be called 'str'. * Return iterators instead of lists where appropriate for atomic type methods (e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.); iter* methods will be removed @@ -307,6 +314,9 @@ References .. [26] python-3000 email ("More wishful thinking") http://mail.python.org/pipermail/python-3000/2006-April/000810.html + [27] python-3000 email ("sets in P3K?") + http://mail.python.org/pipermail/python-3000/2006-April/001286.html + .. [#pep238] PEP 238 (Changing the Division Operator) http://www.python.org/dev/peps/pep-0238