Fill out some references for existing points.

This commit is contained in:
Brett Cannon 2005-04-28 18:57:40 +00:00
parent c1ee09db09
commit 3543af0fb0
1 changed files with 21 additions and 20 deletions

View File

@ -41,23 +41,14 @@ obvious way of doing something is enough. [1]_
Core language Core language
============= =============
* Remove distinction between int and long types. [1]_ * Remove distinction between int and long types [1]_
* True division becomes default behavior * True division becomes default behavior [10]_
* Make all strings be Unicode, and have a separate bytes() type. [1]_ * Make all strings be Unicode, and have a separate bytes() type [1]_
* ``exec`` as a statement is not worth it -- make it a function * ``exec`` as a statement is not worth it -- make it a function
* Add optional declarations for static typing * Add optional declarations for static typing [11]_
* Support only new-style classes; classic classes will be gone. [1]_ * Support only new-style classes; classic classes will be gone [1]_
* Add a 'with' statement:: * Return iterators instead of lists where appropriate for atomic type methods
(e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.)
with self:
.foo = [1, 2, 3]
.bar(4, .foo)
* Return iterators instead of lists
- ``dict.keys()``, ``.values()``, ``.items()``
- ``range()``, ``zip()``
* Replace ``print`` by a function: ``write(x,y,z)``, * Replace ``print`` by a function: ``write(x,y,z)``,
``writeln(x,y,z)`` [2]_ ``writeln(x,y,z)`` [2]_
* Do something so you can catch multiple exceptions using ``except E1, * Do something so you can catch multiple exceptions using ``except E1,
@ -67,13 +58,13 @@ Core language
* ``as`` becomes a keyword [5]_ * ``as`` becomes a keyword [5]_
* Have list comprehensions be syntactic sugar for passing an * Have list comprehensions be syntactic sugar for passing an
equivalent generator expression to ``list()``; as a consequence the equivalent generator expression to ``list()``; as a consequence the
loop variable will no longer be exposed. loop variable will no longer be exposed [12]_
* Comparisons other than ``==`` and ``!=`` between disparate types * Comparisons other than ``==`` and ``!=`` between disparate types
will raise an exception unless explicitly supported by the type [6]_ will raise an exception unless explicitly supported by the type [6]_
To be removed: To be removed:
* The ``lambda`` statement: use nested functions [1]_, [9]_ * The ``lambda`` statement: use nested or named functions [1]_, [9]_
* String exceptions: use instances of an Exception class [2]_ * String exceptions: use instances of an Exception class [2]_
* ```x```: use ``repr(x)`` [2]_ * ```x```: use ``repr(x)`` [2]_
* The ``<>`` operator: use ``!=`` instead [3]_ * The ``<>`` operator: use ``!=`` instead [3]_
@ -83,11 +74,12 @@ To be removed:
Built-ins Built-ins
========= =========
* Make ``range()`` return an iterator * Make built-ins return an iterator where appropriate (e.g. ``range()``,
``zip()``, etc.)
* Relevant functions should consume iterators (e.g. ``min()``, * Relevant functions should consume iterators (e.g. ``min()``,
``max()``) ``max()``)
* Introduce ``trunc()``, which would call the ``__trunc__()`` method on its * Introduce ``trunc()``, which would call the ``__trunc__()`` method on its
argument; suggested use if for objects like float where calling ``__int__()`` argument; suggested use is for objects like float where calling ``__int__()``
has data loss, but an integral representation is still desired [8]_ has data loss, but an integral representation is still desired [8]_
To be removed: To be removed:
@ -148,6 +140,15 @@ References
.. [9] Guido's blog ("The fate of reduce() in Python 3000") .. [9] Guido's blog ("The fate of reduce() in Python 3000")
http://www.artima.com/weblogs/viewpost.jsp?thread=98196 http://www.artima.com/weblogs/viewpost.jsp?thread=98196
.. [10] PEP 238 ("Changing the Division Operator")
http://www.python.org/peps/pep-0238.html
.. [11] Guido's blog ("Python Optional Typechecking Redux")
http://www.artima.com/weblogs/viewpost.jsp?thread=89161
.. [12] PEP 289 ("Generator Expressions")
http://www.python.org/peps/pep-0289.html
Copyright Copyright
========= =========