From 54bf73a54af2432d25f8a286a3748bc907e19da8 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Sun, 23 Feb 2014 21:31:53 -0500 Subject: [PATCH] whatsnew: threading.main_thread, os.urandom persistent handle, sunau.open with. --- Doc/whatsnew/3.4.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 ========== -- 2.50.1