diff -r 180f5bf7d1b9 Doc/whatsnew/3.3.rst --- a/Doc/whatsnew/3.3.rst Thu Sep 11 14:33:02 2014 +0300 +++ b/Doc/whatsnew/3.3.rst Thu Sep 11 15:14:02 2014 +0300 @@ -171,7 +171,7 @@ * Multi-dimensional comparisons are supported for any array type. * One-dimensional memoryviews of hashable (read-only) types with formats B, - b or c are now hashable. (Contributed by Antoine Pitrou in :issue:`13411`) + b or c are now hashable. (Contributed by Antoine Pitrou in :issue:`13411`.) * Arbitrary slicing of any 1-D arrays type is supported. For example, it is now possible to reverse a memoryview in O(1) by using a negative step. @@ -196,7 +196,7 @@ * For further changes see `Build and C API Changes`_ and `Porting C code`_. -(Contributed by Stefan Krah in :issue:`10181`) +(Contributed by Stefan Krah in :issue:`10181`.) .. seealso:: @@ -307,8 +307,8 @@ Python version when a more recent version is installed). In addition to the launcher, the Windows installer now includes an -option to add the newly installed Python to the system PATH (contributed -by Brian Curtin in :issue:`3561`). +option to add the newly installed Python to the system PATH. (Contributed +by Brian Curtin in :issue:`3561`.) .. seealso:: @@ -781,7 +781,7 @@ Both :func:`unicodedata.lookup()` and ``'\N{...}'`` now resolve name aliases, and :func:`unicodedata.lookup()` resolves named sequences too. - (Contributed by Ezio Melotti in :issue:`12753`) + (Contributed by Ezio Melotti in :issue:`12753`.) * Unicode database updated to UCD version 6.1.0 @@ -793,7 +793,7 @@ methods of :class:`bytes` and :class:`bytearray` objects now accept an integer between 0 and 255 as their first argument. - (Contributed by Petri Lehtinen in :issue:`12170`) + (Contributed by Petri Lehtinen in :issue:`12170`.) * The ``rjust()``, ``ljust()``, and ``center()`` methods of :class:`bytes` and :class:`bytearray` now accept a :class:`bytearray` for the ``fill`` @@ -854,7 +854,7 @@ * The sequence documentation has been substantially rewritten to better explain the binary/text sequence distinction and to provide specific documentation sections for the individual builtin sequence types - (:issue:`4966`) + (:issue:`4966`). New Modules @@ -891,7 +891,7 @@ objects representing IPv4 and IPv6 addresses, networks and interfaces (i.e. an IP address associated with a specific IP subnet). -(Contributed by Google and Peter Moody in :pep:`3144`) +(Contributed by Google and Peter Moody in :pep:`3144`.) lzma ---- @@ -900,7 +900,7 @@ using the LZMA algorithm, including support for the ``.xz`` and ``.lzma`` file formats. -(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`) +(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`.) Improved Modules @@ -921,7 +921,7 @@ * :class:`abc.abstractstaticmethod` has been deprecated, use :class:`staticmethod` with :func:`abc.abstractmethod` instead. -(Contributed by Darren Dale in :issue:`11610`) +(Contributed by Darren Dale in :issue:`11610`.) :meth:`abc.ABCMeta.register` now returns the registered subclass, which means it can now be used as a class decorator (:issue:`10868`). @@ -933,7 +933,7 @@ The :mod:`array` module supports the :c:type:`long long` type using ``q`` and ``Q`` type codes. -(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`) +(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`.) base64 @@ -964,14 +964,14 @@ * :class:`bz2.BZ2File` can now read from and write to arbitrary file-like objects, by means of its constructor's *fileobj* argument. - (Contributed by Nadeem Vawda in :issue:`5863`) + (Contributed by Nadeem Vawda in :issue:`5863`.) * :class:`bz2.BZ2File` and :func:`bz2.decompress` can now decompress multi-stream inputs (such as those produced by the :program:`pbzip2` tool). :class:`bz2.BZ2File` can now also be used to create this type of file, using the ``'a'`` (append) mode. - (Contributed by Nir Aides in :issue:`1625`) + (Contributed by Nir Aides in :issue:`1625`.) * :class:`bz2.BZ2File` now implements all of the :class:`io.BufferedIOBase` API, except for the :meth:`detach` and :meth:`truncate` methods. @@ -1018,7 +1018,7 @@ Addition of a new :class:`~collections.ChainMap` class to allow treating a number of mappings as a single unit. (Written by Raymond Hettinger for -:issue:`11089`, made public in :issue:`11297`) +:issue:`11089`, made public in :issue:`11297`.) The abstract base classes have been moved in a new :mod:`collections.abc` module, to better differentiate between the abstract and the concrete @@ -1069,7 +1069,7 @@ push a wide character so the next :meth:`~curses.window.get_wch` will return it -(Contributed by Iñigo Serna in :issue:`6755`) +(Contributed by Iñigo Serna in :issue:`6755`.) datetime -------- @@ -1376,11 +1376,11 @@ :func:`~ftplib.FTP_TLS.ccc` function to revert control channel back to plaintext. This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports. (Contributed - by Giampaolo Rodolà in :issue:`12139`) + by Giampaolo Rodolà in :issue:`12139`.) * Added :meth:`ftplib.FTP.mlsd` method which provides a parsable directory listing format and deprecates :meth:`ftplib.FTP.nlst` and - :meth:`ftplib.FTP.dir`. (Contributed by Giampaolo Rodolà in :issue:`11072`) + :meth:`ftplib.FTP.dir`. (Contributed by Giampaolo Rodolà in :issue:`11072`.) functools @@ -1404,7 +1404,7 @@ A new :func:`~hmac.compare_digest` function has been added to prevent side channel attacks on digests through timing analysis. (Contributed by Nick -Coghlan and Christian Heimes in :issue:`15061`) +Coghlan and Christian Heimes in :issue:`15061`.) http @@ -1436,13 +1436,13 @@ (Contributed by Ezio Melotti in :issue:`15114`, and :issue:`14538`, :issue:`13993`, :issue:`13960`, :issue:`13358`, :issue:`1745761`, :issue:`755670`, :issue:`13357`, :issue:`12629`, :issue:`1200313`, -:issue:`670664`, :issue:`13273`, :issue:`12888`, :issue:`7311`) +:issue:`670664`, :issue:`13273`, :issue:`12888`, :issue:`7311`.) A new :data:`~html.entities.html5` dictionary that maps HTML5 named character references to the equivalent Unicode character(s) (e.g. ``html5['gt;'] == '>'``) has been added to the :mod:`html.entities` module. The dictionary is now also used by :class:`~html.parser.HTMLParser`. (Contributed by Ezio -Melotti in :issue:`11113` and :issue:`15156`) +Melotti in :issue:`11113` and :issue:`15156`.) imaplib @@ -1451,7 +1451,7 @@ The :class:`~imaplib.IMAP4_SSL` constructor now accepts an SSLContext parameter to control parameters of the secure channel. -(Contributed by Sijin Joseph in :issue:`8808`) +(Contributed by Sijin Joseph in :issue:`8808`.) inspect @@ -1462,14 +1462,14 @@ where those names were resolved, making it easier to verify correct internal state when testing code that relies on stateful closures. -(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`) +(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`.) A new :func:`~inspect.getgeneratorlocals` function has been added. This function reports the current binding of local variables in the generator's stack frame, making it easier to verify correct internal state when testing generators. -(Contributed by Meador Inge in :issue:`15153`) +(Contributed by Meador Inge in :issue:`15153`.) io -- @@ -1478,7 +1478,7 @@ exclusively create a new file, and raise a :exc:`FileExistsError` if the file already exists. It is based on the C11 'x' mode to fopen(). -(Contributed by David Townshend in :issue:`12760`) +(Contributed by David Townshend in :issue:`12760`.) The constructor of the :class:`~io.TextIOWrapper` class has a new *write_through* optional argument. If *write_through* is ``True``, calls to @@ -1513,7 +1513,7 @@ The :mod:`math` module has a new function, :func:`~math.log2`, which returns the base-2 logarithm of *x*. -(Written by Mark Dickinson in :issue:`11888`). +(Written by Mark Dickinson in :issue:`11888`.) mmap @@ -1567,7 +1567,7 @@ ('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp.python.committers') >>> -(Contributed by Giampaolo Rodolà in :issue:`9795`) +(Contributed by Giampaolo Rodolà in :issue:`9795`.) os @@ -1744,24 +1744,24 @@ set to False makes the method execute the scheduled events due to expire soonest (if any) and then return immediately. This is useful in case you want to use the :class:`~sched.scheduler` in - non-blocking applications. (Contributed by Giampaolo Rodolà in :issue:`13449`) + non-blocking applications. (Contributed by Giampaolo Rodolà in :issue:`13449`.) * :class:`~sched.scheduler` class can now be safely used in multi-threaded environments. (Contributed by Josiah Carlson and Giampaolo Rodolà in - :issue:`8684`) + :issue:`8684`.) * *timefunc* and *delayfunct* parameters of :class:`~sched.scheduler` class constructor are now optional and defaults to :func:`time.time` and :func:`time.sleep` respectively. (Contributed by Chris Clark in - :issue:`13245`) + :issue:`13245`.) * :meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` *argument* parameter is now optional. (Contributed by Chris Clark in - :issue:`13245`) + :issue:`13245`.) * :meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` now accept a *kwargs* parameter. (Contributed by Chris Clark in - :issue:`13245`) + :issue:`13245`.) select @@ -1787,10 +1787,10 @@ * New functions: * :func:`~shutil.disk_usage`: provides total, used and free disk space - statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`) + statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`.) * :func:`~shutil.chown`: allows one to change user and/or group of the given path also specifying the user/group names and not only their numeric - ids. (Contributed by Sandro Tosi in :issue:`12191`) + ids. (Contributed by Sandro Tosi in :issue:`12191`.) * :func:`shutil.get_terminal_size`: returns the size of the terminal window to which the interpreter is attached. (Contributed by Zbigniew Jędrzejewski-Szmek in :issue:`13609`.) @@ -1813,7 +1813,7 @@ * :func:`~shutil.rmtree` is now resistant to symlink attacks on platforms which support the new ``dir_fd`` parameter in :func:`os.open` and - :func:`os.unlink`. (Contributed by Martin von Löwis and Hynek Schlawack + :func:`os.unlink`. (Contributed by Martin von Löwis and Hynek Schlawack in :issue:`4489`.) @@ -1867,7 +1867,7 @@ The :class:`~smtplib.SMTP_SSL` constructor and the :meth:`~smtplib.SMTP.starttls` method now accept an SSLContext parameter to control parameters of the secure -channel. (Contributed by Kasun Herath in :issue:`8809`) +channel. (Contributed by Kasun Herath in :issue:`8809`.) socket @@ -1887,7 +1887,7 @@ (http://en.wikipedia.org/wiki/Socketcan), on Linux (http://lwn.net/Articles/253425). - (Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:`10141`) + (Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:`10141`.) * The :class:`~socket.socket` class now supports the PF_RDS protocol family (http://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and @@ -1929,37 +1929,37 @@ pseudo-random bytes. * :func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes. - (Contributed by Victor Stinner in :issue:`12049`) + (Contributed by Victor Stinner in :issue:`12049`.) * The :mod:`ssl` module now exposes a finer-grained exception hierarchy in order to make it easier to inspect the various kinds of errors. - (Contributed by Antoine Pitrou in :issue:`11183`) + (Contributed by Antoine Pitrou in :issue:`11183`.) * :meth:`~ssl.SSLContext.load_cert_chain` now accepts a *password* argument to be used if the private key is encrypted. - (Contributed by Adam Simpkins in :issue:`12803`) + (Contributed by Adam Simpkins in :issue:`12803`.) * Diffie-Hellman key exchange, both regular and Elliptic Curve-based, is now supported through the :meth:`~ssl.SSLContext.load_dh_params` and :meth:`~ssl.SSLContext.set_ecdh_curve` methods. - (Contributed by Antoine Pitrou in :issue:`13626` and :issue:`13627`) + (Contributed by Antoine Pitrou in :issue:`13626` and :issue:`13627`.) * SSL sockets have a new :meth:`~ssl.SSLSocket.get_channel_binding` method allowing the implementation of certain authentication mechanisms such as - SCRAM-SHA-1-PLUS. (Contributed by Jacek Konieczny in :issue:`12551`) + SCRAM-SHA-1-PLUS. (Contributed by Jacek Konieczny in :issue:`12551`.) * You can query the SSL compression algorithm used by an SSL socket, thanks to its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :attr:`~ssl.OP_NO_COMPRESSION` can be used to disable compression. - (Contributed by Antoine Pitrou in :issue:`13634`) + (Contributed by Antoine Pitrou in :issue:`13634`.) * Support has been added for the Next Procotol Negotiation extension using the :meth:`ssl.SSLContext.set_npn_protocols` method. - (Contributed by Colin Marc in :issue:`14204`) + (Contributed by Colin Marc in :issue:`14204`.) * SSL errors can now be introspected more easily thanks to :attr:`~ssl.SSLError.library` and :attr:`~ssl.SSLError.reason` attributes. - (Contributed by Antoine Pitrou in :issue:`14837`) + (Contributed by Antoine Pitrou in :issue:`14837`.) * The :func:`~ssl.get_server_certificate` function now supports IPv6. (Contributed by Charles-François Natali in :issue:`11811`.) @@ -1976,7 +1976,7 @@ :func:`stat.filemode`. It can be used to convert a file's mode to a string of the form '-rwxrwxrwx'. -(Contributed by Giampaolo Rodolà in :issue:`14807`) +(Contributed by Giampaolo Rodolà in :issue:`14807`.) struct @@ -2035,8 +2035,8 @@ :class:`threading.Condition`, :class:`threading.Semaphore`, :class:`threading.BoundedSemaphore`, :class:`threading.Event`, and :class:`threading.Timer`, all of which used to be factory functions returning a -class instance, are now classes and may be subclassed. (Contributed by Éric -Araujo in :issue:`10968`). +class instance, are now classes and may be subclassed. (Contributed by Éric +Araujo in :issue:`10968`.) The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword argument to override the default behavior of inheriting the ``deamon`` flag @@ -2066,7 +2066,7 @@ * :func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time.clock_settime` functions with ``CLOCK_xxx`` constants. - (Contributed by Victor Stinner in :issue:`10278`) + (Contributed by Victor Stinner in :issue:`10278`.) To improve cross platform consistency, :func:`~time.sleep` now raises a :exc:`ValueError` when passed a negative sleep value. Previously this was an @@ -2090,7 +2090,7 @@ :meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, and :meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used as context managers. (Contributed by Ezio Melotti and Winston Ewert in -:issue:`10775`) +:issue:`10775`.) :meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult` object. @@ -2117,7 +2117,7 @@ and the generic launchers :program:`xdg-open`, from the FreeDesktop.org project, and :program:`gvfs-open`, which is the default URI handler for GNOME 3. (The former contributed by Arnaud Calmettes in :issue:`13620`, the latter -by Matthias Klose in :issue:`14493`) +by Matthias Klose in :issue:`14493`.) xml.etree.ElementTree @@ -2160,7 +2160,7 @@ * UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster. - (contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and + (Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:`15026`.) diff -r 180f5bf7d1b9 Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst Thu Sep 11 14:33:02 2014 +0300 +++ b/Doc/whatsnew/3.4.rst Thu Sep 11 15:14:02 2014 +0300 @@ -52,7 +52,7 @@ * It's helpful to add the bug/patch number as a comment: The :ref:`~socket.transmogrify()` function was added to the - :mod:`socket` module. (Contributed by P.Y. Developer in :issue:`12345`.) + :mod:`socket` module. (Contributed by P.Y. Developer in :issue:`12345`.) This saves the maintainer the effort of going through the Mercurial log when researching a change. @@ -372,7 +372,7 @@ in :ref:`binary-transforms` and :ref:`text-transforms`. (Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, -:issue:`17828` and :issue:`19619`) +:issue:`17828` and :issue:`19619`.) .. _whatsnew-pep-451: @@ -414,14 +414,14 @@ * Module ``__file__`` attributes (and related values) should now always contain absolute paths by default, with the sole exception of ``__main__.__file__`` when a script has been executed directly using - a relative path (Contributed by Brett Cannon in :issue:`18416`). + a relative path. (Contributed by Brett Cannon in :issue:`18416`.) * All the UTF-\* codecs (except UTF-7) now reject surrogates during both encoding and decoding unless the ``surrogatepass`` error handler is used, with the exception of the UTF-16 decoder (which accepts valid surrogate pairs) and the UTF-16 encoder (which produces them while encoding non-BMP characters). - Contributed by Victor Stinner, Kang-Hao (Kenny) Lu and Serhiy Storchaka in - :issue:`12892`. + (Contributed by Victor Stinner, Kang-Hao (Kenny) Lu and Serhiy Storchaka in + :issue:`12892`.) * New German EBCDIC :ref:`codec ` ``cp273``. (Contributed by Michael Bierenfeld and Andrew Kuchling in :issue:`1097797`.) @@ -633,8 +633,8 @@ in :issue:`12866`.) New :func:`~audioop.byteswap` function converts big-endian samples to -little-endian and vice versa (Contributed by Serhiy Storchaka in -:issue:`19641`). +little-endian and vice versa. (Contributed by Serhiy Storchaka in +:issue:`19641`.) All :mod:`audioop` functions now accept any :term:`bytes-like object`. Strings are not accepted: they didn't work before, now they raise an error right away. @@ -681,8 +681,8 @@ The new :class:`contextlib.suppress` context manager helps to clarify the intent of code that deliberately suppresses exceptions from a single -statement. (Contributed by Raymond Hettinger in :issue:`15806` and -Zero Piraeus in :issue:`19266`) +statement. (Contributed by Raymond Hettinger in :issue:`15806` and +Zero Piraeus in :issue:`19266`.) The new :func:`contextlib.redirect_stdout` context manager makes it easier for utility scripts to handle inflexible APIs that write their output to @@ -693,7 +693,7 @@ from a function that was written to implement a command line interface. It is recommended only for utility scripts because it affects the global state of :data:`sys.stdout`. (Contributed by Raymond Hettinger -in :issue:`15805`) +in :issue:`15805`.) The :mod:`contextlib` documentation has also been updated to include a :ref:`discussion ` of the @@ -765,7 +765,7 @@ to ``distb(tb)``). (Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:`11816` -and Claudiu Popa in :issue:`17916`) +and Claudiu Popa in :issue:`17916`.) New function :func:`~dis.stack_effect` computes the effect on the Python stack of a given opcode and argument, information that is not otherwise available. @@ -855,7 +855,7 @@ for normal callables. The new descriptor also makes it easier to get arbitrary callables (including :func:`~functools.partial` instances) to behave like normal instance methods when included in a class definition. -(Contributed by Alon Horev and Nick Coghlan in :issue:`4331`) +(Contributed by Alon Horev and Nick Coghlan in :issue:`4331`.) .. _whatsnew-singledispatch: @@ -903,7 +903,7 @@ A new :func:`hashlib.pbkdf2_hmac` function provides the `PKCS#5 password-based key derivation function 2 `_. (Contributed by Christian -Heimes in :issue:`18582`) +Heimes in :issue:`18582`.) The :attr:`~hashlib.hash.name` attribute of :mod:`hashlib` hash objects is now a formally supported interface. It has always existed in CPython's @@ -939,17 +939,17 @@ New function :func:`~html.unescape` function converts HTML5 character references to the corresponding Unicode characters. (Contributed by Ezio Melotti in -:issue:`2927`) +:issue:`2927`.) :class:`~html.parser.HTMLParser` accepts a new keyword argument *convert_charrefs* that, when ``True``, automatically converts all character references. For backward-compatibility, its value defaults to ``False``, but it will change to ``True`` in a future version of Python, so you are invited to set it explicitly and update your code to use this new feature. (Contributed -by Ezio Melotti in :issue:`13633`) +by Ezio Melotti in :issue:`13633`.) The *strict* argument of :class:`~html.parser.HTMLParser` is now deprecated. -(Contributed by Ezio Melotti in :issue:`15114`) +(Contributed by Ezio Melotti in :issue:`15114`.) http @@ -1015,19 +1015,19 @@ The :mod:`inspect` module now offers a basic :ref:`command line interface ` to quickly display source code and other -information for modules, classes and functions. (Contributed by Claudiu Popa -and Nick Coghlan in :issue:`18626`) +information for modules, classes and functions. (Contributed by Claudiu Popa +and Nick Coghlan in :issue:`18626`.) :func:`~inspect.unwrap` makes it easy to unravel wrapper function chains created by :func:`functools.wraps` (and any other API that sets the -``__wrapped__`` attribute on a wrapper function). (Contributed by -Daniel Urban, Aaron Iles and Nick Coghlan in :issue:`13266`) +``__wrapped__`` attribute on a wrapper function). (Contributed by +Daniel Urban, Aaron Iles and Nick Coghlan in :issue:`13266`.) As part of the implementation of the new :mod:`enum` module, the :mod:`inspect` module now has substantially better support for custom ``__dir__`` methods and dynamic class attributes provided through -metaclasses (Contributed by Ethan Furman in :issue:`18929` and -:issue:`19030`) +metaclasses. (Contributed by Ethan Furman in :issue:`18929` and +:issue:`19030`.) :func:`~inspect.getfullargspec` and :func:`~inspect.getargspec` now use the :func:`~inspect.signature` API. This allows them to @@ -1038,11 +1038,11 @@ attributes, and report the already bound first argument for bound methods, so it is still necessary to update your code to use :func:`~inspect.signature` directly if those features are desired. -(Contributed by Yury Selivanov in :issue:`17481`) +(Contributed by Yury Selivanov in :issue:`17481`.) :func:`~inspect.signature` now supports duck types of CPython functions, -which adds support for functions compiled with Cython. (Contributed -by Stefan Behnel and Yury Selivanov in :issue:`17159`) +which adds support for functions compiled with Cython. (Contributed +by Stefan Behnel and Yury Selivanov in :issue:`17159`.) ipaddress @@ -1082,7 +1082,7 @@ Logging configuration data received from a socket via the :func:`logging.config.listen` function can now be validated before being processed by supplying a verification function as the argument to the new -*verify* keyword argument. (Contributed by Vinay Sajip in :issue:`15452`.) +*verify* keyword argument. (Contributed by Vinay Sajip in :issue:`15452`.) .. _whatsnew-marshal-3: @@ -1120,7 +1120,7 @@ :func:`~multiprocessing.get_all_start_methods` reports all start methods available on the platform, :func:`~multiprocessing.get_start_method` reports the current start method, and :func:`~multiprocessing.set_start_method` sets -the start method. (Contributed by Richard Oudkerk in :issue:`8713`). +the start method. (Contributed by Richard Oudkerk in :issue:`8713`.) :mod:`multiprocessing` also now has the concept of a ``context``, which determines how child processes are created. New function @@ -1141,7 +1141,7 @@ when using the ``spawn`` or ``forkserver`` start methods. This resolves some edge cases where combining multiprocessing, the ``-m`` command line switch, and explicit relative imports could cause obscure failures in child -processes. (Contributed by Nick Coghlan in :issue:`19946`) +processes. (Contributed by Nick Coghlan in :issue:`19946`.) operator @@ -1176,7 +1176,7 @@ Windows). (Contributed by Brian Curtin in :issue:`11939`.) :func:`os.path.ismount` now recognizes volumes mounted below a drive -root on Windows. (Contributed by Tim Golden in :issue:`9035`.) +root on Windows. (Contributed by Tim Golden in :issue:`9035`.) :func:`os.open` supports two new flags on platforms that provide them, :data:`~os.O_PATH` (un-opened file descriptor), and :data:`~os.O_TMPFILE` @@ -1230,7 +1230,7 @@ functions. (The older API is now deprecated.) In addition to the already supported XML plist format (:data:`~plistlib.FMT_XML`), it also now supports the binary plist format (:data:`~plistlib.FMT_BINARY`). (Contributed by Ronald -Oussoren and others in :issue:`14455`). +Oussoren and others in :issue:`14455`.) poplib @@ -1254,7 +1254,7 @@ (Contributed by Serhiy Storchaka in :issue:`19132`.) Long strings are now wrapped using Python's normal line continuation -syntax. (Contributed by Antoine Pitrou in :issue:`17150`). +syntax. (Contributed by Antoine Pitrou in :issue:`17150`.) pty @@ -1270,13 +1270,13 @@ The :mod:`pydoc` module is now based directly on the :func:`inspect.signature` introspection API, allowing it to provide signature information for a wider variety of callable objects. This change also means that ``__wrapped__`` -attributes are now taken into account when displaying help information -(Contributed by Larry Hastings in :issue:`19674`) +attributes are now taken into account when displaying help information. +(Contributed by Larry Hastings in :issue:`19674`.) The :mod:`pydoc` module no longer displays the ``self`` parameter for already bound methods. Instead, it aims to always display the exact current -signature of the supplied callable (Contributed by Larry Hastings in -:issue:`20710`) +signature of the supplied callable. (Contributed by Larry Hastings in +:issue:`20710`.) In addition to the changes that have been made to :mod:`pydoc` directly, its handling of custom ``__dir__`` methods and various descriptor @@ -1372,7 +1372,7 @@ :exc:`~smtplib.SMTPException` is now a subclass of :exc:`OSError`, which allows both socket level errors and SMTP protocol level errors to be caught in one try/except statement by code that only cares whether or not an error occurred. -(Contributed by Ned Jackson Lovely in :issue:`2118`). +(Contributed by Ned Jackson Lovely in :issue:`2118`.) socket @@ -1412,7 +1412,7 @@ :data:`~ssl.PROTOCOL_TLSv1_1` and :data:`~ssl.PROTOCOL_TLSv1_2` (TLSv1.1 and TLSv1.2 support) have been added; support for these protocols is only available if Python is linked with OpenSSL 1.0.1 or later. (Contributed by Michele Orrù and -Antoine Pitrou in :issue:`16692`) +Antoine Pitrou in :issue:`16692`.) .. _whatsnew34-sslcontext: @@ -1596,7 +1596,7 @@ A new :func:`traceback.clear_frames` function takes a traceback object and clears the local variables in all of the frames it references, reducing the amount of memory consumed. (Contributed by Andrew Kuchling in -:issue:`1565525`). +:issue:`1565525`.) types @@ -1619,7 +1619,7 @@ The http method that will be used by a :class:`~urllib.request.Request` class can now be specified by setting a :class:`~urllib.request.Request.method` -class attribute on the subclass. (Contributed by Jason R Coombs in +class attribute on the subclass. (Contributed by Jason R Coombs in :issue:`18978`.) :class:`~urllib.request.Request` objects are now reusable: if the @@ -1701,14 +1701,14 @@ :issue:`17015`.) :func:`~mock.mock_open` objects now have ``readline`` and ``readlines`` -methods. (Contributed by Toshio Kuratomi in :issue:`17467`.) +methods. (Contributed by Toshio Kuratomi in :issue:`17467`.) venv ---- :mod:`venv` now includes activation scripts for the ``csh`` and ``fish`` -shells (Contributed by Andrew Svetlov in :issue:`15417`.) +shells. (Contributed by Andrew Svetlov in :issue:`15417`.) :class:`~venv.EnvBuilder` and the :func:`~venv.create` convenience function take a new keyword argument *with_pip*, which defaults to ``False``, that @@ -1739,12 +1739,12 @@ ------- New :class:`~weakref.WeakMethod` class simulates weak references to bound -methods. (Contributed by Antoine Pitrou in :issue:`14631`.) +methods. (Contributed by Antoine Pitrou in :issue:`14631`.) New :class:`~weakref.finalize` class makes it possible to register a callback to be invoked when an object is garbage collected, without needing to -carefully manage the lifecycle of the weak reference itself. (Contributed by -Richard Oudkerk in :issue:`15528`) +carefully manage the lifecycle of the weak reference itself. (Contributed by +Richard Oudkerk in :issue:`15528`.) The callback, if any, associated with a :class:`~weakref.ref` is now exposed via the :attr:`~weakref.ref.__callback__` attribute. (Contributed @@ -1879,16 +1879,16 @@ * The new :c:func:`PyType_GetSlot` function has been added to the stable ABI, allowing retrieval of function pointers from named type slots when using - the limited API. (Contributed by Martin von Löwis in :issue:`17162`) + the limited API. (Contributed by Martin von Löwis in :issue:`17162`.) * The new :c:func:`Py_SetStandardStreamEncoding` pre-initialization API allows applications embedding the CPython interpreter to reliably force - a particular encoding and error handler for the standard streams - (Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`) + a particular encoding and error handler for the standard streams. + (Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`.) * Most Python C APIs that don't mutate string arguments are now correctly - marked as accepting ``const char *`` rather than ``char *`` (Contributed - by Serhiy Storchaka in :issue:`1772673`). + marked as accepting ``const char *`` rather than ``char *``. (Contributed + by Serhiy Storchaka in :issue:`1772673`.) * A new shell version of ``python-config`` can be used even when a python interpreter is not available (for example, in cross compilation scenarios). @@ -1958,7 +1958,7 @@ * The ``-R`` option to the :ref:`python regression test suite ` now also checks for memory allocation leaks, using :func:`sys.getallocatedblocks()`. (Contributed by Antoine Pitrou in - :issue:`13390`). + :issue:`13390`.) * ``python -m`` now works with namespace packages. @@ -2021,14 +2021,14 @@ longer imported by default. The marshal module has been improved to load compiled Python code faster. (Contributed by Antoine Pitrou, Christian Heimes and Victor Stinner in :issue:`19219`, :issue:`19218`, :issue:`19209`, - :issue:`19205` and :issue:`9548`) + :issue:`19205` and :issue:`9548`.) * :class:`bz2.BZ2File` is now as fast or faster than the Python2 version for most cases. :class:`lzma.LZMAFile` has also been optimized. (Contributed by Serhiy Storchaka and Nadeem Vawda in :issue:`16034`.) * :func:`random.getrandbits` is 20%-40% faster for small integers (the most - common use case). (Contributed by Serhiy Storchaka in :issue:`16674`). + common use case). (Contributed by Serhiy Storchaka in :issue:`16674`.) * By taking advantage of the new storage format for strings, pickling of strings is now significantly faster. (Contributed by Victor Stinner and @@ -2048,7 +2048,7 @@ * :func:`os.urandom` now uses a lazily-opened persistent file descriptor so as to avoid using many file descriptors when run in parallel from - multiple threads. (Contributed by Antoine Pitrou in :issue:`18756`.) + multiple threads. (Contributed by Antoine Pitrou in :issue:`18756`.) .. _deprecated-3.4: @@ -2246,7 +2246,7 @@ * The [X refs, Y blocks] output of a debug (``--with-pydebug``) build of the CPython interpreter is now off by default. It can be re-enabled using the - ``-X showrefcount`` option. (Contributed by Ezio Melotti in :issue:`17323`.) + ``-X showrefcount`` option. (Contributed by Ezio Melotti in :issue:`17323`.) * The python command and most stdlib scripts (as well as :mod:`argparse`) now output ``--version`` information to ``stdout`` instead of ``stderr`` (for @@ -2395,8 +2395,8 @@ storage). (:issue:`17094`.) * Parameter names in ``__annotations__`` dicts are now mangled properly, - similarly to ``__kwdefaults__``. (Contributed by Yury Selivanov in - :issue:`20625`). + similarly to ``__kwdefaults__``. (Contributed by Yury Selivanov in + :issue:`20625`.) * :attr:`hashlib.hash.name` now always returns the identifier in lower case. Previously some builtin hashes had uppercase names, but now that it is a diff -r 180f5bf7d1b9 Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst Thu Sep 11 14:33:02 2014 +0300 +++ b/Doc/whatsnew/3.5.rst Thu Sep 11 15:14:02 2014 +0300 @@ -138,8 +138,8 @@ ------- * :func:`doctest.DocTestSuite` returns an empty :class:`unittest.TestSuite` if - *module* contains no docstrings instead of raising :exc:`ValueError` - (contributed by Glenn Jones in :issue:`15916`). + *module* contains no docstrings instead of raising :exc:`ValueError`. + (Contributed by Glenn Jones in :issue:`15916`.) glob ---- @@ -154,20 +154,20 @@ * :class:`IMAP4` now supports the context management protocol. When used in a :keyword:`with` statement, the IMAP4 ``LOGOUT`` command will be called automatically at the end of the block. (Contributed by Tarek Ziadé and - Serhiy Storchaka in :issue:`4972`). + Serhiy Storchaka in :issue:`4972`.) imghdr ------ * :func:`~imghdr.what` now recognizes the `OpenEXR `_ - format (contributed by Martin vignali and Cladui Popa in :issue:`20295`). + format. (Contributed by Martin vignali and Cladui Popa in :issue:`20295`.) importlib --------- * :class:`importlib.util.LazyLoader` allows for the lazy loading of modules in - applications where startup time is paramount (contributed by Brett Cannon in - :issue:`17621`). + applications where startup time is paramount. + (Contributed by Brett Cannon in :issue:`17621`.) * :func:`importlib.abc.InspectLoader.source_to_code` is now a static method to make it easier to work with source code in a string. @@ -182,26 +182,26 @@ ------- * :class:`inspect.Signature` and :class:`inspect.Parameter` are now - picklable and hashable (contributed by Yury Selivanov in :issue:`20726` - and :issue:`20334`). + picklable and hashable. (Contributed by Yury Selivanov in :issue:`20726` + and :issue:`20334`.) * New class method :meth:`inspect.Signature.from_callable`, which makes - subclassing of :class:`~inspect.Signature` easier (contributed - by Yury Selivanov and Eric Snow in :issue:`17373`). + subclassing of :class:`~inspect.Signature` easier. (Contributed + by Yury Selivanov and Eric Snow in :issue:`17373`.) ipaddress --------- * :class:`ipaddress.IPv4Network` and :class:`ipaddress.IPv6Network` now accept an ``(address, netmask)`` tuple argument, so as to easily construct - network objects from existing addresses (contributed by Peter Moody - and Antoine Pitrou in :issue:`16531`). + network objects from existing addresses. (Contributed by Peter Moody + and Antoine Pitrou in :issue:`16531`.) os -- * :class:`os.stat_result` now has a :attr:`~os.stat_result.st_file_attributes` - attribute on Windows (contributed by Ben Hoyt in :issue:`21719`). + attribute on Windows. (Contributed by Ben Hoyt in :issue:`21719`.) shutil ------ @@ -216,8 +216,8 @@ * Different constants of :mod:`signal` module are now enumeration values using the :mod:`enum` module. This allows meaningful names to be printed during - debugging, instead of integer “magic numbers”. (contributed by Giampaolo - Rodola' in :issue:`21076`) + debugging, instead of integer “magic numbers”. (Contributed by Giampaolo + Rodola' in :issue:`21076`.) smtpd ----- @@ -241,8 +241,8 @@ ------- * A new :meth:`~smtplib.SMTP.auth` method provides a convenient way to - implement custom authentication mechanisms (contributed by Milan Oberkirch in - :issue:`15014`). + implement custom authentication mechanisms. + (Contributed by Milan Oberkirch in :issue:`15014`.) socket ------ @@ -251,7 +251,7 @@ by using high-performance :func:`os.sendfile` function on UNIX resulting in uploads being from 2x to 3x faster than when using plain :meth:`socket.socket.send`. - (contributed by Giampaolo Rodola' in :issue:`17552`) + (Contributed by Giampaolo Rodola' in :issue:`17552`.) time ---- @@ -267,8 +267,8 @@ xmlrpc ------ -* :class:`xmlrpc.client.ServerProxy` is now a :term:`context manager` - (contributed by Claudiu Popa in :issue:`20627`). +* :class:`xmlrpc.client.ServerProxy` is now a :term:`context manager`. + (Contributed by Claudiu Popa in :issue:`20627`.) Optimizations @@ -361,9 +361,9 @@ * The deprecated "strict" mode and argument of :class:`~html.parser.HTMLParser`, :meth:`HTMLParser.error`, and the :exc:`HTMLParserError` exception have been - removed (contributed by Ezio Melotti in :issue:`15114`). + removed. (Contributed by Ezio Melotti in :issue:`15114`.) The *convert_charrefs* argument of :class:`~html.parser.HTMLParser` is - now ``True`` by default (contributed by Berker Peksag in :issue:`21047`). + now ``True`` by default. (Contributed by Berker Peksag in :issue:`21047`.) Changes in the C API --------------------