Add set literals.
Clarify that the new string type will be 'str'.
This commit is contained in:
parent
fe146e8d57
commit
5e7d3e4ad0
10
pep-3100.txt
10
pep-3100.txt
|
@ -104,6 +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]_
|
||||||
|
{/} 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:
|
To be removed:
|
||||||
|
|
||||||
|
@ -129,6 +135,7 @@ Atomic Types
|
||||||
* Remove distinction between int and long types [1]_
|
* Remove distinction between int and long types [1]_
|
||||||
(int may become an abstract base type, with short and long subtypes.)
|
(int may become an abstract base type, with short and long subtypes.)
|
||||||
* Make all strings be Unicode, and have a separate bytes() type [1]_
|
* 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
|
* Return iterators instead of lists where appropriate for atomic type methods
|
||||||
(e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.); iter*
|
(e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.); iter*
|
||||||
methods will be removed
|
methods will be removed
|
||||||
|
@ -307,6 +314,9 @@ References
|
||||||
.. [26] python-3000 email ("More wishful thinking")
|
.. [26] python-3000 email ("More wishful thinking")
|
||||||
http://mail.python.org/pipermail/python-3000/2006-April/000810.html
|
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)
|
.. [#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