@@ -44,6 +44,10 @@ There are many new modules (including brand new XML support through
4444the xml package, and i18n support through the gettext module); a list
4545of all new modules is included below. Lots of bugs have been fixed.
4646
47+ The process for making major new changes to the language has changed
48+ since Python 1.6. Enhancements must now be documented by a Python
49+ Enhancement Proposal (PEP) before they can be accepted.
50+
4751There are several important syntax enhancements, described in more
4852detail below:
4953
@@ -59,6 +63,21 @@ Other important changes:
5963
6064 - Optional collection of cyclical garbage
6165
66+ Python Enhancement Proposal (PEP)
67+ ---------------------------------
68+
69+ PEP stands for Python Enhancement Proposal. A PEP is a design
70+ document providing information to the Python community, or describing
71+ a new feature for Python. The PEP should provide a concise technical
72+ specification of the feature and a rationale for the feature.
73+
74+ We intend PEPs to be the primary mechanisms for proposing new
75+ features, for collecting community input on an issue, and for
76+ documenting the design decisions that have gone into Python. The PEP
77+ author is responsible for building consensus within the community and
78+ documenting dissenting opinions.
79+
80+ The PEPs are available at http://python.sourceforge.net/peps/.
6281
6382Augmented Assignment
6483--------------------
@@ -127,7 +146,7 @@ This prints
127146 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
128147
129148List comprehensions originated as a patch set from Greg Ewing; Skip
130- Montanaro and Thomas Wouters also contributed.
149+ Montanaro and Thomas Wouters also contributed. Described by PEP 202.
131150
132151
133152Extended Import Statement
@@ -157,7 +176,7 @@ Note that 'as' is not a new keyword -- it is recognized only in this
157176context (this is only possible because the syntax for the import
158177statement doesn't involve expressions).
159178
160- Implemented by Thomas Wouters.
179+ Implemented by Thomas Wouters. Described by PEP 221.
161180
162181
163182Extended Print Statement
@@ -181,7 +200,7 @@ is equivalent to
181200
182201 print "Hello world"
183202
184- Design and implementation by Barry Warsaw.
203+ Design and implementation by Barry Warsaw. Described by PEP 214.
185204
186205
187206Optional Collection of Cyclical Garbage
@@ -211,7 +230,7 @@ A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
211230map(None, seq1, seq2, ...) when the sequences have the same length;
212231i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
213232the lists are not all the same length, the shortest list wins:
214- zip([1,2,3], [10,20]) returns [(1,10), (2,20)].
233+ zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
215234
216235sys.version_info is a tuple (major, minor, micro, level, serial).
217236
@@ -227,8 +246,11 @@ does the same work as this common idiom:
227246 dict[key] = []
228247 dict[key].append(item)
229248
230- New exceptions, TabError and IndentationError, thate are subclasses on
231- SyntaxError. XXX
249+ There are two new variants of SyntaxError that are raised for
250+ indentation-related errors: IndentationError and TabError.
251+
252+ Changed \x to consume exactly two hex digits; see PEP 223. Added \U
253+ escape that consumes exactly eight hex digits.
232254
233255The limits on the size of expressions and file in Python source code
234256have been raised from 2**16 to 2**32. Previous versions of Python
@@ -271,6 +293,12 @@ webbrowser - a platform-independent API to launch a web browser.
271293Changed Modules
272294---------------
273295
296+ array -- new methods for array objects: count, extend, index, pop, and
297+ remove
298+
299+ binascii -- new functions b2a_hex and a2b_hex that convert between
300+ binary data and its hex representation
301+
274302calendar -- Many new functions that support features including control
275303over which day of the week is the first day, returning strings instead
276304of printing them. Also new symbolic constants for days of week,
@@ -291,10 +319,17 @@ gzip -- readline and readlines now accept optional size arguments
291319httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
292320the module doc strings for details.
293321
322+ locale -- implement getdefaultlocale for Win32 and Macintosh
323+
324+ marshal -- no longer dumps core when marshaling deeply nested or
325+ recursive data structures
326+
327+ os -- new functions isatty, seteuid, setegid, setreuid, setregid
328+
294329os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
295330support under Unix.
296331
297- os/pty -- support for openpty and forkpty by Thomas Wouters.
332+ os/pty -- support for openpty and forkpty
298333
299334os.path -- fix semantics of os.path.commonprefix
300335
@@ -306,12 +341,14 @@ readline -- new functions to read, write and truncate history files.
306341The readline section of the library reference manual contains an
307342example.
308343
344+ select -- add interface to poll system call
345+
309346shutil -- new copyfileobj function
310347
311348SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
312349HTTP server.
313350
314- Tkinter -- flatten optimization by Fredrik Lundh
351+ Tkinter -- optimization of function flatten
315352
316353urllib -- scans environment variables for proxy configuration,
317354e.g. http_proxy.
@@ -348,7 +385,8 @@ of header files. (Few of these ever need to be included explicitly;
348385they are all included by Python.h.)
349386
350387Trent Mick ensured portability to 64-bit platforms, under both Linux
351- and Win64, especially for the new Intel Itanium processor.
388+ and Win64, especially for the new Intel Itanium processor. Mick also
389+ added large file support for Linux64 and Win64.
352390
353391The C APIs to return an object's size have been update to consistently
354392use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
@@ -357,7 +395,9 @@ concrete interfaces used PyXXX_Size. The old names,
357395e.g. PyObject_Length, are still available for backwards compatibility
358396at the API level, but are deprecated.
359397
360- PyOS_CheckStack - XXX
398+ The PyOS_CheckStack function has been implemented on Windows by
399+ Fredrik Lundh. It prevents Python from failing with a stack overflow
400+ on Windows.
361401
362402The GC changes resulted in creation of two new slots on object,
363403tp_traverse and tp_clear. The augmented assignment changes result in
@@ -366,10 +406,16 @@ the createion of a new slot for each in-place operator.
366406The GC API creates new requirements for container types implemented in
367407C extesion modules. See Include/objimpl.h for details.
368408
369- PyString_Decode / PyString_Encode. ???
409+ PyErr_Format has been updated to automatically calculate the size of
410+ the buffer needed to hold the formatted result string. This change
411+ prevents crashes caused by programmer error.
412+
413+ New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
370414
371- Numerous new APIs were added, e.g.
415+ PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
416+ that are the same as their non-Ex counterparts except they take an
417+ extra flag argument that tells them to close the file when done.
372418
373- XXX: Fill this out.
419+ XXX There were other API changes that should be fleshed out here .
374420
375421======================================================================
0 commit comments