summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMatthias Bussonnier <bussonniermatthias@gmail.com>2019-05-28 07:10:59 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-28 07:10:59 (GMT)
commit3880f263d2994fb1eba25835dddccb0cf696fdf0 (patch)
tree0c40e3b7cab9b3aa59600cec290548709d7c7dc4 /Doc
parent436c2b0d67da68465e709a96daac7340af3a5238 (diff)
downloadcpython-3880f263d2994fb1eba25835dddccb0cf696fdf0.zip
cpython-3880f263d2994fb1eba25835dddccb0cf696fdf0.tar.gz
cpython-3880f263d2994fb1eba25835dddccb0cf696fdf0.tar.bz2
bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)
It has been documented as deprecated and to be removed in 3.8; From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`. https://bugs.python.org/issue36933
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/sys.rst59
-rw-r--r--Doc/tools/susp-ignored.csv1
-rw-r--r--Doc/whatsnew/3.8.rst4
3 files changed, 4 insertions, 60 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 74aa271..5bde687 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -781,22 +781,6 @@ always available.
for details.) Use it only for debugging purposes.
-.. function:: get_coroutine_wrapper()
-
- Returns ``None``, or a wrapper set by :func:`set_coroutine_wrapper`.
-
- .. versionadded:: 3.5
- See :pep:`492` for more details.
-
- .. note::
- This function has been added on a provisional basis (see :pep:`411`
- for details.) Use it only for debugging purposes.
-
- .. deprecated:: 3.7
- The coroutine wrapper functionality has been deprecated, and
- will be removed in 3.8. See :issue:`32591` for details.
-
-
.. data:: hash_info
A :term:`struct sequence` giving parameters of the numeric hash
@@ -1384,49 +1368,6 @@ always available.
This function has been added on a provisional basis (see :pep:`411`
for details.) Use it only for debugging purposes.
-.. function:: set_coroutine_wrapper(wrapper)
-
- Allows intercepting creation of :term:`coroutine` objects (only ones that
- are created by an :keyword:`async def` function; generators decorated with
- :func:`types.coroutine` or :func:`asyncio.coroutine` will not be
- intercepted).
-
- The *wrapper* argument must be either:
-
- * a callable that accepts one argument (a coroutine object);
- * ``None``, to reset the wrapper.
-
- If called twice, the new wrapper replaces the previous one. The function
- is thread-specific.
-
- The *wrapper* callable cannot define new coroutines directly or indirectly::
-
- def wrapper(coro):
- async def wrap(coro):
- return await coro
- return wrap(coro)
- sys.set_coroutine_wrapper(wrapper)
-
- async def foo():
- pass
-
- # The following line will fail with a RuntimeError, because
- # ``wrapper`` creates a ``wrap(coro)`` coroutine:
- foo()
-
- See also :func:`get_coroutine_wrapper`.
-
- .. versionadded:: 3.5
- See :pep:`492` for more details.
-
- .. note::
- This function has been added on a provisional basis (see :pep:`411`
- for details.) Use it only for debugging purposes.
-
- .. deprecated-removed:: 3.7 3.8
- The coroutine wrapper functionality has been deprecated, and
- will be removed in 3.8. See :issue:`32591` for details.
-
.. function:: _enablelegacywindowsfsencoding()
Changes the default filesystem encoding and errors mode to 'mbcs' and
diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv
index a0e7868..85263d4 100644
--- a/Doc/tools/susp-ignored.csv
+++ b/Doc/tools/susp-ignored.csv
@@ -337,7 +337,6 @@ library/zipapp,,:main,"$ python -m zipapp myapp -m ""myapp:main"""
library/zipapp,,:fn,"pkg.mod:fn"
library/zipapp,,:callable,"pkg.module:callable"
library/stdtypes,,::,>>> m[::2].tolist()
-library/sys,,`,# ``wrapper`` creates a ``wrap(coro)`` coroutine:
whatsnew/3.5,,:root,'WARNING:root:warning\n'
whatsnew/3.5,,:warning,'WARNING:root:warning\n'
whatsnew/3.5,,::,>>> addr6 = ipaddress.IPv6Address('::1')
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 125cefe..860d6cc 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -973,6 +973,10 @@ The following features and APIs have been removed from Python 3.8:
:func:`fileinput.FileInput` which was ignored and deprecated since Python 3.6
has been removed. :issue:`36952` (Contributed by Matthias Bussonnier)
+* The function :func:`sys.set_coroutine_wrapper` deprecated in Python 3.7 has
+ been removed; :func:`sys.get_coroutine_wrapper` now always return ``None``.
+ :issue:`36933` (Contributed by Matthias Bussonnier)
+
Porting to Python 3.8
=====================