[Python-checkins] cpython: whatsnew: epoll supports with.

r.david.murray python-checkins at python.org
Tue Dec 31 17:48:03 CET 2013


http://hg.python.org/cpython/rev/44b6b492c7e3
changeset: 88230:44b6b492c7e3
user: R David Murray <rdmurray at bitdance.com>
date: Tue Dec 31 11:17:21 2013 -0500
summary:
 whatsnew: epoll supports with.
Also reworded the description of the feature in the docs.
files:
 Doc/library/select.rst | 11 ++++++++---
 Doc/whatsnew/3.4.rst | 9 +++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -58,9 +58,14 @@
 which can be used as Edge or Level Triggered interface for I/O
 events. *sizehint* is deprecated and completely ignored. *flags* can be set
 to :const:`EPOLL_CLOEXEC`, which causes the epoll descriptor to be closed
- automatically when :func:`os.execve` is called. See section
- :ref:`epoll-objects` below for the methods supported by epolling objects.
- They also support the :keyword:`with` statement.
+ automatically when :func:`os.execve` is called.
+
+ See the :ref:`epoll-objects` section below for the methods supported by
+ epolling objects.
+
+ ``epoll`` objects support the context management protocol: when used in a
+ :keyword:`with` statement, the new file descriptor is automatically closed
+ at the end of the block.
 
 The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
 
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -851,6 +851,15 @@
 (Contributed by Christian Heimes in :issue:`16595` and :issue:`19324`.)
 
 
+select
+------
+
+:class:`~select.epoll` objects now support the context management protocol.
+When used in a :keyword:`with` statement, the :meth:`~select.epoll.close`
+method will be called automatically at the end of the block. (Contributed
+by Serhiy Storchaka in :issue:`16488`.)
+
+
 shelve
 ------
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /