From 8ca944f9e192fe73224ea259f44eebf64f5d5503 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 15 Dec 2005 04:55:32 +0000 Subject: [PATCH] With permission, add lots more details and references. Add a couple of changes which are likely, but not definite. At least until Guido changes his mind. ;-) --- pep-3000.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/pep-3000.txt b/pep-3000.txt index 837a2e3d6..8ae8ad421 100644 --- a/pep-3000.txt +++ b/pep-3000.txt @@ -49,11 +49,12 @@ Core language * Support only new-style classes; classic classes will be gone [1]_ * Return iterators instead of lists where appropriate for atomic type methods (e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.) + (Do we keep iter*() methods or remove them? I vote remove. -- nn) * Replace ``print`` by a function [16]_ * Do something so you can catch multiple exceptions using ``except E1, E2, E3:``. Maybe use ``except E1, E2, E3 as err:`` if you want the error variable? [3]_ -* ``True`` and ``False`` become keywords [4]_ +* ``None``, ``True`` and ``False`` become keywords [4]_ * ``as`` becomes a keyword [5]_ * Have list comprehensions be syntactic sugar for passing an equivalent generator expression to ``list()``; as a consequence the @@ -61,6 +62,12 @@ Core language * Comparisons other than ``==`` and ``!=`` between disparate types will raise an exception unless explicitly supported by the type [6]_ * Exceptions will grow an attribute to store the traceback [13]_ +* floats will not be acceptable as arguments in place of ints for operations + where floats are inadvertantly accepted (PyArg_ParseTuple() i & l formats) +* Imports will be absolute by default. + Relative imports must be explicitly specified [19]_ +* __init__.py will be optional in sub-packages. __init__.py will still + be required for top-level packages. To be removed: @@ -70,6 +77,12 @@ To be removed: * ```x```: use ``repr(x)`` [2]_ * The ``<>`` operator: use ``!=`` instead [3]_ * Unbound methods [7]_ +* METH_OLDARGS +* __getslice__, __setslice__, __delslice__ [17]_ +* C APIs (see code): + PyFloat_AsString, PyFloat_AsReprString, PyFloat_AsStringEx, + PySequence_In, PyEval_EvalFrame, PyEval_CallObject, + _PyObject_Del, _PyObject_GC_Del, _PyObject_GC_Track, _PyObject_GC_UnTrack Built-in Namespace @@ -82,6 +95,7 @@ Built-in Namespace * Introduce ``trunc()``, which would call the ``__trunc__()`` method on its argument; suggested use is for objects like float where calling ``__int__()`` has data loss, but an integral representation is still desired [8]_ +* Exception hierarchy changes [20]_ To be removed: @@ -106,18 +120,41 @@ To be removed: * ``basestring.find()`` and ``basestring.rfind()``; use ``basestring.index()`` or ``basestring.rindex()`` in a try/except block [15]_ +* ``file.xreadlines()`` method [17]_ Standard library ================ * Reorganize the standard library to not be as shallow +* Move test code to where it belongs, there will be no more test() functions + in the standard library To be removed: -* ``string`` and other deprecated modules [1]_ -* ``sys.exc_type``: not thread-safe; use ``sys.exc_info`` [2]_ +* Deprecated modules, methods, parameters, attributes, etc. [1]_ [17]_ [18]_ + There may be other modules, the most common are listed below. + stdlib modules to be removed (see docstrings and comments in the source): + * ``macfs``, ``new``, ``reconvert``, ``stringold``, ``xmllib`` + * ``pcre``, ``pypcre``, ``strop`` + stdlib modules to be removed (see PEP 4): [18]_ + * ``posixfile``, ``pre``, ``regsub``, ``rfc822``, + * ``statcache``, ``string``, ``TERMIOS`` + * ``mimetools``, ``MimeWriter``, ``mimify``, + * ``mpz``, ``rgbimage`` + * Everything in lib-old: [18]_ + * Para.py, addpack.py, cmp.py, cmpcache.py, codehack.py, + * dircmp.py, dump.py, find.py, fmt.py, grep.py, lockfile.py, + * newdir.py, ni.py, packmail.py, poly.py, rand.py, statcache.py, + * tb.py, tzparse.py, util.py, whatsound.py, whrandom.py, zmod.py + +* ``sys.exitfunc``: use atexit module instead [17]_ +* ``sys.exc_type``, ``sys.exc_values``, ``sys.exc_traceback``: + not thread-safe; use ``sys.exc_info()`` or an attribute + of the exception [2]_ [13]_ [17]_ +* ``array.read``, ``array.write`` [17]_ +* ``operator.isCallable``, ``operator.sequenceIncludes`` [17]_ References ========== @@ -171,6 +208,21 @@ References .. [16] python-dev email (Replacement for print in Python 3.0) http://mail.python.org/pipermail/python-dev/2005-September/056154.html +.. [17] Python docs + http://docs.python.org/ref/sequence-methods.html + http://docs.python.org/lib/module-sys.html + http://docs.python.org/lib/module-operator.html + http://docs.python.org/lib/module-array.html + http://docs.python.org/lib/bltin-file-objects.html + +.. [18] PEP 4 ("Deprecation of Standard Modules") + http://www.python.org/peps/pep-0004.html + +.. [19] PEP 328 ("Imports: Multi-Line and Absolute/Relative") + http://www.python.org/peps/pep-0328.html + +.. [20] PEP 352 ("Required Superclass for Exceptions") + http://www.python.org/peps/pep-0352.html Copyright =========