66:Release: |release |
77:Date: |today |
88
9- .. Fix accents on Kristjan Valur Jonsson, Fuerstenau, Tarek Ziade.
9+ .. Fix accents on Kristjan Valur Jonsson, Fuerstenau
1010
1111.. $Id$
1212 Rules for maintenance:
@@ -53,6 +53,11 @@ This article explains the new features in Python 2.7. The final
5353release of 2.7 is currently scheduled for June 2010; the detailed
5454schedule is described in :pep: `373 `.
5555
56+ Python 2.7 is planned to be the last major release in the 2.x series.
57+ Though more major releases have not been absolutely ruled out, it's
58+ likely that the 2.7 release will have an extended period of
59+ maintenance compared to earlier 2.x versions.
60+
5661.. Compare with previous release in 2 - 3 sentences here.
5762 add hyperlink when the documentation becomes available online.
5863
@@ -458,10 +463,12 @@ Several performance enhancements have been added:
458463 conversion function that supports arbitrary bases.
459464 (Patch by Gawain Bolton; :issue: `6713 `.)
460465
461- * The :meth: `rindex `, :meth: `rpartition `, and :meth: `rsplit ` methods
462- of string objects now uses a fast reverse-search algorithm instead of
463- a character-by-character scan. This is often faster by a factor of 10.
464- (Added by Florent Xicluna; :issue: `7462 `.)
466+ * The :meth: `split `, :meth: `replace `, :meth: `rindex `,
467+ :meth: `rpartition `, and :meth: `rsplit ` methods of string-like types
468+ (strings, Unicode strings, and :class: `bytearray ` objects) now use a
469+ fast reverse-search algorithm instead of a character-by-character
470+ scan. This is sometimes faster by a factor of 10. (Added by
471+ Florent Xicluna; :issue: `7462 ` and :issue: `7622 `.)
465472
466473* The :mod: `pickle ` and :mod: `cPickle ` modules now automatically
467474 intern the strings used for attribute names, reducing memory usage
@@ -585,11 +592,16 @@ changes, or look through the Subversion logs for all the details.
585592 left-alignment. This has been changed to right-alignment, which seems
586593 more sensible for numeric types. (Changed by Mark Dickinson; :issue: `6857 `.)
587594
588- * Distutils is being more actively developed, thanks to Tarek Ziade
589- who has taken over maintenance of the package. A new
590- :file: `setup.py ` subcommand, ``check ``, will
591- check that the arguments being passed to the :func: `setup ` function
592- are complete and correct (:issue: `5732 `).
595+ * Distutils is being more actively developed, thanks to Tarek Ziadé
596+ who has taken over maintenance of the package, so there are a number
597+ of fixes and improvments.
598+
599+ A new :file: `setup.py ` subcommand, ``check ``, will check that the
600+ arguments being passed to the :func: `setup ` function are complete
601+ and correct (:issue: `5732 `).
602+
603+ Byte-compilation by the ``install_lib `` subcommand is now only done
604+ if the ``sys.dont_write_bytecode `` setting allows it (:issue: `7071 `).
593605
594606 :func: `distutils.sdist.add_defaults ` now uses
595607 *package_dir * and *data_files * to create the MANIFEST file.
@@ -601,7 +613,7 @@ changes, or look through the Subversion logs for all the details.
601613 It is no longer mandatory to store clear-text passwords in the
602614 :file: `.pypirc ` file when registering and uploading packages to PyPI. As long
603615 as the username is present in that file, the :mod: `distutils ` package will
604- prompt for the password if not present. (Added by Tarek Ziade ,
616+ prompt for the password if not present. (Added by Tarek Ziadé ,
605617 based on an initial contribution by Nathan Van Gheem; :issue: `4394 `.)
606618
607619 A Distutils setup can now specify that a C extension is optional by
@@ -614,7 +626,7 @@ changes, or look through the Subversion logs for all the details.
614626 :meth: `read_pkg_file ` method will read the contents of a package's
615627 :file: `PKG-INFO ` metadata file. For an example of its use, see
616628 :ref: `reading-metadata `.
617- (Contributed by Tarek Ziade ; :issue: `7457 `.)
629+ (Contributed by Tarek Ziadé ; :issue: `7457 `.)
618630
619631 :file: `setup.py ` files will now accept a :option: `--no-user-cfg ` switch
620632 to skip reading the :file: `~/.pydistutils.cfg ` file. (Suggested by
@@ -643,6 +655,10 @@ changes, or look through the Subversion logs for all the details.
643655 recorded in a gzipped file by providing an optional timestamp to
644656 the constructor. (Contributed by Jacques Frechet; :issue: `4272 `.)
645657
658+ Files in gzip format can be padded with trailing zero bytes; the
659+ :mod: `gzip ` module will now consume these trailing bytes. (Fixed by
660+ Tadek Pietraszek and Brian Curtin; :issue: `2846 `.)
661+
646662* The default :class: `HTTPResponse ` class used by the :mod: `httplib ` module now
647663 supports buffering, resulting in much faster reading of HTTP responses.
648664 (Contributed by Kristjan Valur Jonsson; :issue: `4879 `.)
@@ -662,7 +678,9 @@ changes, or look through the Subversion logs for all the details.
662678
663679 The :class: `io.FileIO ` class now raises an :exc: `OSError ` when passed
664680 an invalid file descriptor. (Implemented by Benjamin Peterson;
665- :issue: `4991 `.)
681+ :issue: `4991 `.) The :meth: `truncate ` method now preserves the
682+ file position; previously it would change the file position to the
683+ end of the new file. (Fixed by Pascal Chambon; :issue: `6939 `.)
666684
667685* New function: ``itertools.compress(data, selectors) `` takes two
668686 iterators. Elements of *data * are returned if the corresponding
@@ -718,6 +736,14 @@ changes, or look through the Subversion logs for all the details.
718736 passed to the callable.
719737 (Contributed by lekma; :issue: `5585 `.)
720738
739+ The :class: `Pool ` class, which controls a pool of worker processes,
740+ now has an optional *maxtasksperchild * parameter. Worker processes
741+ will perform the specified number of tasks and then exit, causing the
742+ :class: `Pool ` to start a new worker. This is useful if tasks may leak
743+ memory or other resources, or if some tasks will cause the worker to
744+ become very large.
745+ (Contributed by Charles Cazabon; :issue: `6963 `.)
746+
721747* The :mod: `nntplib ` module now supports IPv6 addresses.
722748 (Contributed by Derek Morr; :issue: `1664 `.)
723749
@@ -730,6 +756,10 @@ changes, or look through the Subversion logs for all the details.
730756 contributed by Travis H.; :issue: `6508 `. Support for initgroups added
731757 by Jean-Paul Calderone; :issue: `7333 `.)
732758
759+ The :func: `normpath ` function now preserves Unicode; if its input path
760+ is a Unicode string, the return value is also a Unicode string.
761+ (Fixed by Matt Giuca; :issue: `5827 `.)
762+
733763* The :mod: `pydoc ` module now has help for the various symbols that Python
734764 uses. You can now do ``help('<<') `` or ``help('@') ``, for example.
735765 (Contributed by David Laban; :issue: `4739 `.)
@@ -753,7 +783,7 @@ changes, or look through the Subversion logs for all the details.
753783 :func: `getuserbase ` returns the value of the :envvar: `USER_BASE `
754784 environment variable, giving the path to a directory that can be used
755785 to store data.
756- (Contributed by Tarek Ziade ; :issue: `6693 `.)
786+ (Contributed by Tarek Ziadé ; :issue: `6693 `.)
757787
758788* The :mod: `socket ` module's :class: `SSL ` objects now support the
759789 buffer API, which fixed a test suite failure. (Fixed by Antoine Pitrou;
@@ -795,18 +825,33 @@ changes, or look through the Subversion logs for all the details.
795825 (Contributed by Jeremy Hylton.)
796826
797827* The ``sys.version_info `` value is now a named tuple, with attributes
798- named ``major ``, ``minor ``, ``micro ``, ``releaselevel ``, and ``serial ``.
799- (Contributed by Ross Light; :issue: `4285 `.)
800-
801- * The :mod: `tarfile ` module now supports filtering the :class: `TarInfo `
828+ named :attr: `major `, :attr: `minor `, :attr: `micro `,
829+ :attr: `releaselevel `, and :attr: `serial `. (Contributed by Ross
830+ Light; :issue: `4285 `.)
831+
832+ :func: `sys.getwindowsversion ` also returns a named tuple,
833+ with attributes named :attr: `service_pack_major `,
834+ :attr: `service_pack_minor `,
835+ :attr: `suite_mask `, and :attr: `product_type `. (Contributed by
836+ Brian Curtin; :issue: `7766 `.)
837+
838+ * The :mod: `tarfile ` module's default error handling has changed, to
839+ no longer suppress fatal errors. The default error level was previously 0,
840+ which meant that errors would only result in a message being written to the
841+ debug log, but because the debug log is not activated by default,
842+ these errors go unnoticed. The default error level is now 1,
843+ which raises an exception if there's an error.
844+ (Changed by Lars Gustäbel; :issue: `7357 `.)
845+
846+ :mod: `tarfile ` now supports filtering the :class: `TarInfo `
802847 objects being added to a tar file. When you call :meth: `TarFile.add `,
803848 instance, you may supply an optional *filter * argument
804849 that's a callable. The *filter * callable will be passed the
805850 :class: `TarInfo ` for every file being added, and can modify and return it.
806851 If the callable returns ``None ``, the file will be excluded from the
807852 resulting archive. This is more powerful than the existing
808853 *exclude * argument, which has therefore been deprecated.
809- (Added by Lars Gustaebel ; :issue: `6856 `.)
854+ (Added by Lars Gustäbel ; :issue: `6856 `.)
810855
811856* The :mod: `threading ` module's :meth: `Event.wait ` method now returns
812857 the internal flag on exit. This means the method will usually
@@ -815,12 +860,22 @@ changes, or look through the Subversion logs for all the details.
815860 a timeout was provided and the operation timed out.
816861 (Contributed by Tim Lesher; :issue: `1674032 `.)
817862
818- * The :func: `is_zipfile ` function in the :mod: `zipfile ` module now
819- accepts a file object, in addition to the path names accepted in earlier
820- versions. (Contributed by Gabriel Genellina; :issue: `4756 `.)
863+ * The :class: `UserDict ` class is now a new-style class. (Changed by
864+ Benjamin Peterson.)
865+
866+ * The :mod: `zipfile ` module's :class: `ZipFile ` now supports the context
867+ management protocol, so you can write ``with zipfile.ZipFile(...) as f: ... ``.
868+ (Contributed by Brian Curtin; :issue: `5511 `.)
821869
822870 :mod: `zipfile ` now supports archiving empty directories and
823871 extracts them correctly. (Fixed by Kuba Wieczorek; :issue: `4710 `.)
872+ Reading files out of an archive is now faster, and interleaving
873+ :meth: `read ` and :meth: `readline ` now works correctly.
874+ (Contributed by Nir Aides; :issue: `7610 `.)
875+
876+ The :func: `is_zipfile ` function in the module now
877+ accepts a file object, in addition to the path names accepted in earlier
878+ versions. (Contributed by Gabriel Genellina; :issue: `4756 `.)
824879
825880.. ======================================================================
826881.. whole new modules get described in subsections here
@@ -1046,10 +1101,12 @@ Changes to Python's build process and to the C API include:
10461101 instruction currently executing, and then look up the line number
10471102 corresponding to that address. (Added by Jeffrey Yasskin.)
10481103
1049- * New function: :cfunc: `PyLong_AsLongAndOverflow ` approximates a Python long
1050- integer as a C :ctype: `long `. If the number is too large to fit into
1051- a :ctype: `long `, an *overflow * flag is set and returned to the caller.
1052- (Contributed by Case Van Horsen; :issue: `7528 `.)
1104+ * New functions: :cfunc: `PyLong_AsLongAndOverflow ` and
1105+ :cfunc: `PyLong_AsLongLongAndOverflow ` approximates a Python long
1106+ integer as a C :ctype: `long ` or :ctype: `long long `.
1107+ If the number is too large to fit into
1108+ the output type, an *overflow * flag is set and returned to the caller.
1109+ (Contributed by Case Van Horsen; :issue: `7528 ` and :issue: `7767 `.)
10531110
10541111* New function: stemming from the rewrite of string-to-float conversion,
10551112 a new :cfunc: `PyOS_string_to_double ` function was added. The old
0 commit comments