From: R David Murray Date: Mon, 24 Feb 2014 02:31:53 +0000 (-0500) Subject: whatsnew: threading.main_thread, os.urandom persistent handle, sunau.open with. X-Git-Tag: v3.4.1rc1~233^2~224 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54bf73a54af2432d25f8a286a3748bc907e19da8;p=python whatsnew: threading.main_thread, os.urandom persistent handle, sunau.open with. --- diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 62c85bb9c0..bf4b7e6c16 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1208,7 +1208,10 @@ sunau The :meth:`~sunau.getparams` method now returns a namedtuple rather than a plain tuple. (Contributed by Claudiu Popa in :issue:`18901`.) -:meth:`sunau.open` now supports the context manager protocol (:issue:`18878`). +:meth:`sunau.open` now supports the context manager protocol: when used in a +:keyword:`with` block, the ``close`` method of the returned object will be +called automatically at the end of the block. (Contributed by Serhiy Storchaka +in :issue:`18878`.) sys @@ -1236,6 +1239,15 @@ specified placeholder is added (by default, ``[...]``, stored in the new :issue:`18585`.) +threading +--------- + +The :class:`~threading.Thread` object representing the main thread can be +obtained from the new :func:`~threading.main_thread` function. In normal +conditions this will be the thread from which the Python interpreter was +started. (Contributed by Andrew Svetlov in :issue:`18882`.) + + traceback --------- @@ -1569,6 +1581,10 @@ Significant Optimizations ``malloc`` in ``obmalloc``. Artificial benchmarks show about a 3% memory savings. +* :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`.) + Deprecated ==========