Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bc930f

Browse files
committed
whatsnew: epoll supports with.
Also reworded the description of the feature in the docs.
1 parent d9ddd3f commit 2bc930f

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

Doc/library/select.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,14 @@ The module defines the following:
5858
which can be used as Edge or Level Triggered interface for I/O
5959
events. *sizehint* is deprecated and completely ignored. *flags* can be set
6060
to :const:`EPOLL_CLOEXEC`, which causes the epoll descriptor to be closed
61-
automatically when :func:`os.execve` is called. See section
62-
:ref:`epoll-objects` below for the methods supported by epolling objects.
63-
They also support the :keyword:`with` statement.
61+
automatically when :func:`os.execve` is called.
62+
63+
See the :ref:`epoll-objects` section below for the methods supported by
64+
epolling objects.
65+
66+
``epoll`` objects support the context management protocol: when used in a
67+
:keyword:`with` statement, the new file descriptor is automatically closed
68+
at the end of the block.
6469

6570
The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
6671

Doc/whatsnew/3.4.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,15 @@ New :func:`resource.prlimit` function and Linux specific constants.
851851
(Contributed by Christian Heimes in :issue:`16595` and :issue:`19324`.)
852852

853853

854+
select
855+
------
856+
857+
:class:`~select.epoll` objects now support the context management protocol.
858+
When used in a :keyword:`with` statement, the :meth:`~select.epoll.close`
859+
method will be called automatically at the end of the block. (Contributed
860+
by Serhiy Storchaka in :issue:`16488`.)
861+
862+
854863
shelve
855864
------
856865

0 commit comments

Comments
 (0)