Issue 24180: Document sys.(set|get)_coroutine_wrapper

(Merge 3.5)
This commit is contained in:
Yury Selivanov 2015-05-31 17:13:27 -04:00
commit 126e02604f

View file

@ -576,6 +576,18 @@ always available.
*service_pack_major*, *suite_mask*, and *product_type*.
.. 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 debug purposes.
.. data:: hash_info
A :term:`struct sequence` giving parameters of the numeric hash
@ -1061,6 +1073,28 @@ always available.
thus not likely to be implemented elsewhere.
.. function:: set_coroutine_wrapper(wrapper)
Allows to intercept creation of :term:`coroutine` objects.
*wrapper* 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.
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 debug purposes.
.. data:: stdin
stdout
stderr