From d487898001421e3b7b4811af2d8e21a7b6d4042b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 4 May 2006 18:15:10 +0000 Subject: [PATCH] Third time trying to commit the new pronouncement about set literals. :-( Also mention removing __mod__ and __divmod__ from float. --- pep-3100.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pep-3100.txt b/pep-3100.txt index 19c52126b..472fc0627 100644 --- a/pep-3100.txt +++ b/pep-3100.txt @@ -104,12 +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]). +* Set literals and comprehensions [27]_ [28]_ + {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 literal for an empty set; use set() (or {1}&{2} :-). There's no frozenset literal; they are too rarely needed. - The {/} part is still controversial. To be removed: @@ -117,6 +117,7 @@ To be removed: * ``raise Exception, "message"``: use ``raise Exception("message")`` [14]_ * ```x```: use ``repr(x)`` [2]_ * The ``<>`` operator: use ``!=`` instead [3]_ +* The __mod__ and __divmod__ special methods on float. [29]_ * Unbound methods [7]_ * METH_OLDARGS, WITH_CYCLE_GC * __getslice__, __setslice__, __delslice__ [17]_ @@ -317,6 +318,12 @@ References .. [27] python-3000 email ("sets in P3K?") http://mail.python.org/pipermail/python-3000/2006-April/001286.html + [28] python-3000 email ("sets in P3K?") + http://mail.python.org/pipermail/python-3000/2006-May/001666.html + + [29] python-3000 email ("bug in modulus?") + http://mail.python.org/pipermail/python-3000/2006-May/001735.html + .. [#pep238] PEP 238 (Changing the Division Operator) http://www.python.org/dev/peps/pep-0238