Third time trying to commit the new pronouncement about set literals. :-(
Also mention removing __mod__ and __divmod__ from float.
This commit is contained in:
parent
10535b0182
commit
d487898001
13
pep-3100.txt
13
pep-3100.txt
|
@ -104,12 +104,12 @@ Core language
|
||||||
and semantics is evil.
|
and semantics is evil.
|
||||||
* Attributes on functions of the form ``func_whatever`` will be renamed
|
* Attributes on functions of the form ``func_whatever`` will be renamed
|
||||||
``__whatever__`` [25]_
|
``__whatever__`` [25]_
|
||||||
* Set literals and comprehensions [27]_
|
* Set literals and comprehensions [27]_ [28]_
|
||||||
{/} means set(); {x} means set([x]); {x, y} means set([x, y]).
|
{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)).
|
{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)).
|
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.
|
There's no frozenset literal; they are too rarely needed.
|
||||||
The {/} part is still controversial.
|
|
||||||
|
|
||||||
To be removed:
|
To be removed:
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ To be removed:
|
||||||
* ``raise Exception, "message"``: use ``raise Exception("message")`` [14]_
|
* ``raise Exception, "message"``: use ``raise Exception("message")`` [14]_
|
||||||
* ```x```: use ``repr(x)`` [2]_
|
* ```x```: use ``repr(x)`` [2]_
|
||||||
* The ``<>`` operator: use ``!=`` instead [3]_
|
* The ``<>`` operator: use ``!=`` instead [3]_
|
||||||
|
* The __mod__ and __divmod__ special methods on float. [29]_
|
||||||
* Unbound methods [7]_
|
* Unbound methods [7]_
|
||||||
* METH_OLDARGS, WITH_CYCLE_GC
|
* METH_OLDARGS, WITH_CYCLE_GC
|
||||||
* __getslice__, __setslice__, __delslice__ [17]_
|
* __getslice__, __setslice__, __delslice__ [17]_
|
||||||
|
@ -317,6 +318,12 @@ References
|
||||||
.. [27] python-3000 email ("sets in P3K?")
|
.. [27] python-3000 email ("sets in P3K?")
|
||||||
http://mail.python.org/pipermail/python-3000/2006-April/001286.html
|
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)
|
.. [#pep238] PEP 238 (Changing the Division Operator)
|
||||||
http://www.python.org/dev/peps/pep-0238
|
http://www.python.org/dev/peps/pep-0238
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue